|
|
|
Oskom Forums Добро пожаловать на Oskom Forums.
|
-
Помогите со скриптом
Дело такое:стал писать скрипт на ламбер, описал все деревья переходы от дерева к дереву... и тд и тп все вроде работает но есть одна проблема в скрипте задается
ласт таргет, тип дерева но когда дело доходит до рубки пытаясь рубить дерево пишет It appears immune your to blow
(Transperency circle вырублен)
вот пример скрипта:
:Rubaka
set $a chop
set $b you put
set $c fail
set lastobjectid 1079926200
Set lasttargetx charposx + 2
Set lasttargety charposy
Set lasttargetz charposz
Set lasttargetid 1087673613
set lasttargetkind 3
Set laststatictype 3283
Send F10
Waitfortarget
Send F7
:1
If lastmsg = $a
goto 4
End_if
If lastmsg = $c
goto 2
End_If
if_not lastmsg = $b
wait 100
goto 1
End_if
:2
Send F10
wait 500
Send F7
:3
If lastmsg = $a
goto 4
End_if
If lastmsg = $c
goto 2
End_If
while_not lastmsg = $b
wait 100
goto 3
End_while
:4
Set #k #k + 1
wait 2000
(тюкает два раза потом переходит к другому дереву(может грамоздко но я тока учусь))
-
Flaming soul
Проверь, чтоб по листьям и веткам не тыкал.Строго по стволам.
-
Crystal Orchid
В частности, проверь в настройках Ультимы, что у тебя отключена прозрачность.
-
Можешь сделать таким образом, открой InsideUO есть такая полезная утилита, нади все картинки стволов, деревья состят из ствола и кроны, у них разные типы, выпиши все типы стволов и устанавливай когда нужно.
-
Собственно вот список всех деревьев.
TreeType = 3274;
TreeType2 = 3275;
TreeType3 = 3276;
TreeType4 = 3277;
TreeType5 = 3280;
TreeType6 = 3283;
TreeType7 = 3286;
TreeType8 = 3288;
TreeType9 = 3290;
TreeType10 = 3293;
TreeType11 = 3296;
TreeType12 = 3299;
TreeType13 = 3302;
-
И вообще в пилоте писать такие скрипты неблагодарное дело, все равно ничего путного не выйдет только всю голову сломаешь, у меня вот есть какой то скрипт как он работает не знаю (сам пользуюсь UOscriptOE1.75)
но вроде без ошибок, и вроде должен рубить как надо.
Код:
// Forestry
//
// Script for lamberjeckers for UOpilot v1.07 beta 5 WK
// By Vyacheslav Gruzdev (Urfin), Dresden, 2004
// slav2@chem.dvgu.ru
//UOclient settings:
// The keys {PageUp} {PageDown} {End} {Home}
// must be assigned for movement, check it.
// Any other program (UOassist for example) can't use this keys.
// F11 - Lastobject Waitfortarget Lasttarget (Used in work subprogram).
// F8 - Open backpack (used in emergency subprogram).
// Turn on always run feature when training, get a horse.
// Open your status window (hits, stamina, mana et al.).
// How to get "standard backpack"? :-)
// Set resolution of inner UO window to 640*480
// Turn off "Offset interface windows rather than
// perfectly stacking them". Your backpack opens in the up
// and right corner of UO window and have the same coords.
// This coords are depending on outer size of UO window.
// Diminish outer size of UO window to inner size. You cann't
// diminish it more than inner size of UO. Close bagpack.
// When you push F12 button, you will open "standard backpack" ;-)
// The point 515, 55 is used to detect your backpack is opened,
// closed or overlapped with paperdoll. Sorry, my backpack is blue.
// You need to correct the colour of 515, 55 in emergency subprogram.
//UOpilot settings:
// This script works with UOpilot v1.07 beta 5 WK
// Open script #10 window. We create array %forestry there.
// Write in that window:
// wait 1000
// Run this script and pause it. Don't stop it or close. Return to script Forestry.
// Open lastobject table and add your hatchet in the line 1 position
// Choose time delay between lines, I use 0ms and it works good
// Change UOpilot process priority to above average (win2k users)
// Turn off ''Otobrazhat' hod vipolnenija skripta'' (russ)
// Turn on ''Otobrazhat' zapuschennye skripty''
// Script #10 window is red now, isn't it?
// Turn on ''Prikrepljat' vse skripty pri starte UOpilot'a''
// Turn off ''Pri zakrytii klienta priostanavlivat' skript''
// Turn off all '' Pri oshibke chtenija parametrov chara'' ---->
// ----> ''Ostanavlivat' skript''
// ----> ''Priostonavlivat' skript''
// ----> ''Informirovat' ob oshibke''
// Remember. To start processing of script after restarting client
// you should lock this script to a new client window.
// Enable hotkey Ctrl + Alt + A. Move your mouse pointer to the head
// of client window and push Ctrl + Alt + A
// Turn on ''Otobrazhat' parametry chara'' --> ''Aktivnogo skripta''
// OK. In the UOpilot ''Char parameters'' window you can see your stats.
// If not, select your client in the UOpilot settings properly
// If not, close all windows and start at first UOpilot, then
// UOclient. Then Ctrl + Alt + A with active UOpilot
// window and loaded script. I have 2.0.3 client, win2ksp4 and all is okay.
// To autostart client after connection lost and continue running script!
// 1. Edit your uo.cfg file. You should enter line: RememberAcctPW=on
// 2. Start client. Enter your password and check that save password is marked.
// 3. Login and close client.
// 4. Points with coords: 320, 240 and 320, 300 (size of UO window is 640 * 480)
// are used for detection connection lost and login windows. Don't overlap this
// points by mouse pointer or any other windows. I hope that you will have
// the same colours of this points. If not, you have to correct this in
// emergency subprogram.
// 5. Sometimes the window "Not enough virtual memory" appears. I don't know
// what is better. Continue running script or restart. In the first case make sure
// that this window will not overlap important points when it appears.
// Script description:
// Use this script in a forest or jungle terrain, no swamp supported as a very poor area
// Select thoroughness of the work. Fast work or slow. There are two types of forests.
// "Right" forest and "bad" forest. In "bad" forest some of trees grow adjacently.
// Work in "right" forest and choose fast, or choose slow. In joungle this option is not applied
// This option works during generation new map and can not be changed later when working.
set $workspd fast
//set $workspd slow
//Script consists of three parts:
// 1. CREATING BLANK MAP
// Choose your location, and write your charposx charposy or mark rune
// Choose step radius of your work area, I think #n 40 - 50 is OK
set #n 50
//Start script:
// You see default settings: mode = work, terrain = jungle
// First of all, you need to create blank map. Wait more than 5 secs and click OK
// to enter menu. Next, click Ok without waiting (you have 5 secs) to roll modes.
// When you choose your mode wait more then 5 secs and click OK.
// You see start msg. Next click OK without waiting to start task or wait more
// then 5 secs to roll terrain. And finally, when you select your terrain, wait more
// then 5 secs to see start msg again. It is simple.
// If you cann't change settings in real time, change default settings manually
// and enable no messages line to skip all messages.
set $mode work //work, train or blank
set $terrain jungle // forest or jungle
//set $no messages
// ----------> Warnings: <----------
// You may get an ERROR msg if you begin work without creating blank map
// You may get an ERROR msg if you forget to open script #10 window
// You may get an ERROR msg if you leave the area of previously created blank map
// If your selection of mode is wrong when you start, don't worry, stop script.
// you have 2-3 sec for it before script continue running and make changes.
// We cannot write array information in a file yet. If you close UOpilot,
// all info will be lost and you'll have to create a new map :-(
// 2. TESTING YOUR CONNECTION AND TRAINING
// If you know your speed already, change it manually
// or start autodetection.
set #wait 250 //set #wait 0 - autodetection
// Start script and select mode "train" in a menu.
// Your char begins scout the area you select.
// You may stop training at any time or skip it at all. Skip training in jungles!
// May be your char lived in jungle before? :-) Don't skip it in forests.
// Open char parameters. In the line ''lastliftedid'' you see current progress
// Now is 1111111111, when 50% work is done you see 1118888111
// when work is near to end - 1888888881. This is area %, not radius.
// 3. WORKING
// Return to the start or near position. Use your rune for it or
// check charposx charposy in UOpilot char parameters
// Start script with a work mode selection, select your terrain.
// At the beginning, char chops trees not so fast as he can.
// You'll get ''It appears immune to your blow'' messages
// It's Ok. Char continues his studying.
// When you run this script in the same area several
// times, char will chop trees very fast.
// Good luck.
// At the end of this file you may see [End of file] mark, check it.
//____________________________________________________
if $no = messages
goto letsgo
end_if
if charposx = 0 and charposy = 0
msg X = 0; Y = 0. Cannot run at all. Enable ''Lock all Scripts'' hotkey and lock script to UO
end_script
end_if
//_____Menu_____
:menu1
set timer
msg START or wait 5s and select MODE < $mode; $terrain >
if timer < 5000
:letsgo
if $mode = work
goto startwork
end_if
if $mode = train
goto starttrain
end_if
goto startblank
end_if
:menu2
if $mode = work
set $mode train
else
if $mode = train
set $mode blank
else
set $mode work
end_if
end_if
set timer
msg MODE SELECTION < $mode >
if timer < 5000
goto menu2
end_if
set timer
msg START or wait 5s and select TERRAIN < $mode; $terrain >
if timer < 5000
if $mode = work
goto startwork
end_if
if $mode = train
goto starttrain
end_if
goto startblank
end_if
:menu3
set timer
if $terrain = forest
set $terrain jungle
else
set $terrain forest
end_if
msg TERRAIN SELECTION < $terrain >
if timer < 3000
goto menu3
end_if
goto menu1
//____Start New Map___
:startblank
if_not $no = messages
msg Ok, you choose new map generation
msg X = charposx ; Y = charposy ; $terrain
wait 3000
else
say New map generation, X = charposx, Y = charposy ; $terrain
end_if
set #x charposx - #n
set #y charposy - #n
if #x < 1
set #x 1
end_if
if #y < 1
set #y 1
end_if
repeat #n + #n
repeat #n + #n
if $terrain = jungle
set #tempx #x / 6 * 6
set #tempx #x - #tempx
set #tempy #y / 5 * 5
set #tempy #y - #tempy
if #tempx = 0 and #tempy = 0
set %forestry.10[#x #y] 0
else
set %forestry.10[#x #y] -1
end_if
else
set #tempx #x / 2 * 2
set #tempx #x - #tempx
set #tempy #y / 3 * 3
set #tempy #y - #tempy
if $workspd = fast
if #tempx = 0 and #tempy = 0
set %forestry.10[#x #y] 0
else
set %forestry.10[#x #y] -1
end_if
else
if #tempx = 0 or #tempy = 0
set %forestry.10[#x #y] 0
else
set %forestry.10[#x #y] -1
end_if
end_if
end_if
set #x #x + 1
end_repeat
set #y #y + 1
set #x charposx - #n
if #x < 1
set #x 1
end_if
end_repeat
if_not $no = messages
msg Done.
end_if
end_script
//_____Start Train____
:starttrain
set #grad 1
if_not $no = messages
if $terrain = jungle
msg Jungle..? My former home. I needn't train in jungles.
set timer
msg Begin training or wait 5s and start working
if timer > 5000
set $mode work
gosub speed
goto startwork
end_if
msg Ok, Scouting. Terrain is jungle
else
msg OK, Scouting. Terrain is forest
end_if
wait 2000
end_if
gosub speed
goto start
//_____Start Work____
:startwork
if $terrain = jungle
set #grad 6
else
set #grad 7
end_if
if_not $no = messages
msg Understood, harvesting.
wait 3000
end_if
gosub speed
//____Main Body - Movement__
:start
set #startx charposx
set #starty charposy
set #step 0 //Nulevoj shag
set #h hits
set #rnd 0 //Round 0
set #err 0
set lastliftedid 1111111111
if $terrain = jungle
set #ntree 4
set %tree[1] 3395
set %tree[2] 3417
set %tree[3] 3440
set %tree[4] 3461
else
set #ntree 11
set %tree[1] 3277
set %tree[2] 3280
set %tree[3] 3283
set %tree[4] 3286
set %tree[5] 3288
set %tree[6] 3289
set %tree[7] 3290
set %tree[8] 3293
set %tree[9] 3296
set %tree[10] 3299
set %tree[11] 3302
end_if
set $msg1 what do you want
set $msg2 it appears
set $msg3 you can't reach
set $msg4 you put
set $msg5 your skill
set $msg6 you see
set $msg7 there are no logs
set $msg9 world save
set $msg10 you hack at
:1
set #rnd #rnd + 1 //New round begins
set #temp ( ( #rnd * #grad ) + 5 ) * 100 / #n
if #temp > 99
set lastliftedid 8888888888
if_not $no = messages
msg Work complete
end_if
end_script
end_if
if #temp > 45
set lastliftedid 1111881111
end_if
if #temp > 68
set lastliftedid 1118888111
end_if
if #temp > 83
set lastliftedid 1188888811
end_if
if #temp > 96
set lastliftedid 1888888881
end_if
set $right free
set $left free
set $switch 00
set $turn right
set #p 0
set #end 1
set #ai 0
if #rnd > 5
if #err > 0
set #err #err - 1
else
set #wait #wait - 10
say ; No errors, now wait is #wait
end_if
end_if
if #err > 3
if #wait < #maxwait
set #wait #wait + 20
say ; No, I'll run a bit slower
end_if
set #err #err - 2
end_if
set #dx ( #rnd - 1 ) * #grad + charposx - #startx
gosub tunex
set #maxstep #rnd * #grad + charposy - #starty
:12
if_not $switch = 11
if_not chardir = 0
send pageup
wait #wait
end_if
set #chary charposy
send pageup
wait #wait
if #chary = charposy
send pageup
wait #wait
end_if
if_not #chary = charposy //shag udalsja
set $left free
set $right free
if #p < 0 and $switch = 00
set #dx ( #rnd - 1 ) * #grad + charposx - #startx
gosub tunex2
end_if
set $switch 00
set #p #p - 1
set #end 1
set #step #step + 1
set #parity #step / #grad * #grad - #step
if #parity = 0
gosub $mode
end_if
if_not #step < #maxstep
set #step 0
goto 2
end_if
goto 12
end_if
if $left = free and $right = free
set #end #end + 1
else
set #end #end + 2
end_if
if $switch = 01
:13
set $switch 10
if $left = free and $right = free
if $turn = left
set $turn right
else
set $turn left
end_if
end_if
end_if
if $switch = 10
set #dx ( #rnd - 1 ) * #grad + charposx - #startx
gosub tunex2
if $left = stop and $right = stop
gosub emergency
if #leftstop < #rightstop
set $turn left
set #end #leftstop
else
set $turn right
set #end #rightstop
end_if
if #ai > 8
set #temp random 10
if random 2 = 0
set $turn left
repeat #temp
send home
wait #wait
end_repeat
else
set $turn right
repeat #temp
send pagedown
wait #wait
end_repeat
end_if
end_if
set $left free
set $right free
set #ai #ai + 2
if #ai > #end
set #end #ai
end_if
set #p 0
if_not chardir = 4
send end
wait #wait
end_if
repeat #ai / 2
set #chary charposy
send end
wait #wait + 50
if_not #chary = charposy
set #step #step - 1
set #p #p + 1
else
break
end_if
end_repeat
end_if
set $switch 11
end_if
end_if
if ( $left = free or $right = free ) and ( $switch = 00 or $switch = 11 )
repeat #end / 2
if $turn = right and $right = free
if_not chardir = 2
send pagedown
wait #wait
end_if
set #charx charposx
send pagedown
wait #wait
if charposx = #charx
send pagedown
wait #wait
end_if
if #charx = charposx
set $turn left
set $right stop
set #end #end + 1
set #rightstop #end + 1
goto 13
end_if
else
if $turn = left and $left = free
if_not chardir = 6
send home
wait #wait
end_if
set #charx charposx
send home
wait #wait
if charposx = #charx
send home
wait #wait
end_if
if #charx = charposx
set $turn right
set $left stop
set #end #end + 1
set #leftstop #end + 1
goto 13
end_if
end_if
end_if
end_repeat
set $switch 01
end_if
goto 12
:2
set $right free
set $left free
set $switch 00
set $turn right
set #p 0
set #end 1
set #ai 0
if #err > 3
if #wait < #maxwait
set #wait #wait + 20
say ; I'll run slower next round, OK?
end_if
set #err #err - 2
end_if
set #dy charposy - #starty + ( #rnd * #grad )
gosub tuney
set #maxstep #rnd * #grad - charposx + #startx
:22
if_not $switch = 11
if_not chardir = 2
send pagedown
wait #wait
end_if
set #charx charposx
send pagedown
wait #wait
if #charx = charposx
send pagedown
wait #wait
end_if
if_not #charx = charposx
set $left free
set $right free
if #p < 0 and $switch = 00
set #dy charposy - #starty + ( #rnd * #grad )
gosub tuney2
end_if
set $switch 00
set #p #p - 1
set #end 1
set #step #step + 1
set #parity #step / #grad * #grad - #step
if #parity = 0
gosub $mode
end_if
if_not #step < #maxstep
set #step 0
goto 3
end_if
goto 22
end_if
if $left = free and $right = free
set #end #end + 1
else
set #end #end + 2
end_if
if $switch = 01
:23
set $switch 10
if $left = free and $right = free
if $turn = left
set $turn right
else
set $turn left
end_if
end_if
end_if
if $switch = 10
set #dy charposy - #starty + ( #rnd * #grad )
gosub tuney2
if $left = stop and $right = stop
gosub emergency
if #leftstop < #rightstop
set $turn left
set #end #leftstop
else
set $turn right
set #end #rightstop
end_if
if #ai > 8
set #temp random 10
if random 2 = 0
set $turn left
repeat #temp
send pageup
wait #wait
end_repeat
else
set $turn right
repeat #temp
send end
wait #wait
end_repeat
end_if
end_if
set $left free
set $right free
set #ai #ai + 2
if #ai > #end
set #end #ai
end_if
set #p 0
if_not chardir = 6
send home
wait #wait
end_if
repeat #ai / 2
set #charx charposx
send home
wait #wait + 50
if_not #charx = charposx
set #step #step - 1
set #p #p + 1
else
break
end_if
end_repeat
end_if
set $switch 11
end_if
end_if
if ( $left = free or $right = free ) and ( $switch = 00 or $switch = 11 )
repeat #end / 2
if $turn = right and $right = free
if_not chardir = 4
send end
wait #wait
end_if
set #chary charposy
send end
wait #wait
if charposy = #chary
send end
wait #wait
end_if
if #chary = charposy
set $turn left
set $right stop
set #end #end + 1
set #rightstop #end + 1
goto 23
end_if
else
if $turn = left and $left = free
if_not chardir = 0
send pageup
wait #wait
end_if
set #chary charposy
send pageup
wait #wait
if charposy = #chary
send pageup
wait #wait
end_if
if #chary = charposy
set $turn right
set $left stop
set #end #end + 1
set #leftstop #end + 1
goto 23
end_if
end_if
end_if
end_repeat
set $switch 01
end_if
goto 22
:3
set $right free
set $left free
set $switch 00
set $turn right
set #p 0
set #end 1
set #ai 0
if #err > 3
if #wait < #maxwait
set #wait #wait + 20
say ; So fast for me, I'm tired
end_if
set #err #err - 2
end_if
set #dx charposx - #startx - ( #rnd * #grad )
gosub tunex
set #maxstep #rnd * #grad - charposy + #starty
:32
if_not $switch = 11
if_not chardir = 4
send end
wait #wait
end_if
set #chary charposy
send end
wait #wait
if #chary = charposy
send end
wait #wait
end_if
if_not #chary = charposy
set $left free
set $right free
if #p < 0 and $switch = 00
set #dx charposx - #startx - ( #rnd * #grad )
gosub tunex2
end_if
set $switch 00
set #p #p - 1
set #end 1
set #step #step + 1
set #parity #step / #grad * #grad - #step
if #parity = 0
gosub $mode
end_if
if_not #step < #maxstep
set #step 0
goto 4
end_if
goto 32
end_if
if $left = free and $right = free
set #end #end + 1
else
set #end #end + 2
end_if
if $switch = 01
:33
set $switch 10
if $left = free and $right = free
if $turn = left
set $turn right
else
set $turn left
end_if
end_if
end_if
if $switch = 10
set #dx charposx - #startx - ( #rnd * #grad )
gosub tunex2
if $left = stop and $right = stop
gosub emergency
if #leftstop < #rightstop
set $turn left
set #end #leftstop
else
set $turn right
set #end #rightstop
end_if
if #ai > 8
set #temp random 10
if random 2 = 0
set $turn left
repeat #temp
send pagedown
wait #wait
end_repeat
else
set $turn right
repeat #temp
send home
wait #wait
end_repeat
end_if
end_if
set $left free
set $right free
set #ai #ai + 2
if #ai > #end
set #end #ai
end_if
set #p 0
if_not chardir = 4
send pageup
wait #wait
end_if
repeat #ai / 2
set #chary charposy
send pageup
wait #wait + 50
if_not #chary = charposy
set #step #step - 1
set #p #p + 1
else
break
end_if
end_repeat
end_if
set $switch 11
end_if
end_if
if ( $left = free or $right = free ) and ( $switch = 00 or $switch = 11 )
repeat #end / 2
if $turn = right and $right = free
if_not chardir = 6
send home
wait #wait
end_if
set #charx charposx
send home
wait #wait
if charposx = #charx
send home
wait #wait
end_if
if #charx = charposx
set $turn left
set $right stop
set #end #end + 1
set #rightstop #end + 1
goto 33
end_if
else
if $turn = left and $left = free
if_not chardir = 2
send pagedown
wait #wait
end_if
set #charx charposx
send pagedown
wait #wait
if charposx = #charx
send pagedown
wait #wait
end_if
if #charx = charposx
set $turn right
set $left stop
set #end #end + 1
set #leftstop #end + 1
goto 33
end_if
end_if
end_if
end_repeat
set $switch 01
end_if
goto 32
:4
set $right free
set $left free
set $switch 00
set $turn right
set #p 0
set #end 1
set #ai 0
if #err > 3
if #wait < #maxwait
set #wait #wait + 20
say ; Hmm, are you gonna pay me?
end_if
set #err #err - 2
end_if
set #dy charposy - #starty - ( #rnd * #grad )
gosub tuney
set #maxstep #rnd * #grad + charposx - #startx
:42
if_not $switch = 11
if_not chardir = 6
send home
wait #wait
end_if
set #charx charposx
send home
wait #wait
if #charx = charposx
send home
wait #wait
end_if
if_not #charx = charposx
set $left free
set $right free
if #p < 0 and $switch = 00
set #dy charposy - #starty - ( #rnd * #grad )
gosub tuney2
end_if
set $switch 00
set #p #p - 1
set #end 1
set #step #step + 1
set #parity #step / #grad * #grad - #step
if #parity = 0
gosub $mode
end_if
if_not #step < #maxstep
set #step 0
goto 1
end_if
goto 42
end_if
if $left = free and $right = free
set #end #end + 1
else
set #end #end + 2
end_if
if $switch = 01
:43
set $switch 10
if $left = free and $right = free
if $turn = left
set $turn right
else
set $turn left
end_if
end_if
end_if
if $switch = 10
set #dy charposy - #starty - ( #rnd * #grad )
gosub tuney2
if $left = stop and $right = stop
gosub emergency
if #leftstop < #rightstop
set $turn left
set #end #leftstop
else
set $turn right
set #end #rightstop
end_if
if #ai > 8
set #temp random 10
if random 2 = 0
set $turn left
repeat #temp
send end
wait #wait
end_repeat
else
set $turn right
repeat #temp
send pageup
wait #wait
end_repeat
end_if
end_if
set $left free
set $right free
set #ai #ai + 2
if #ai > #end
set #end #ai
end_if
set #p 0
if_not chardir = 2
send pagedown
wait #wait
end_if
repeat #ai / 2
set #charx charposx
send pagedown
wait #wait + 50
if_not #charx = charposx
set #step #step - 1
set #p #p + 1
else
break
end_if
end_repeat
end_if
set $switch 11
end_if
end_if
if ( $left = free or $right = free ) and ( $switch = 00 or $switch = 11 )
repeat #end / 2
if $turn = right and $right = free
if_not chardir = 0
send pageup
wait #wait
end_if
set #chary charposy
send pageup
wait #wait
if charposy = #chary
send pageup
wait #wait
end_if
if #chary = charposy
set $turn left
set $right stop
set #end #end + 1
set #rightstop #end + 1
goto 43
end_if
else
if $turn = left and $left = free
if_not chardir = 4
send end
wait #wait
end_if
set #chary charposy
send end
wait #wait
if charposy = #chary
send end
wait #wait
end_if
if #chary = charposy
set $turn right
set $left stop
set #end #end + 1
set #leftstop #end + 1
goto 43
end_if
end_if
end_if
end_repeat
set $switch 01
end_if
goto 42
//_____Work subprogram_____
:work
gosub emergency
set lastobjectid 1
set lasttargetkind 3
set #x 0
set #y 0
set #tm 0
:next
set #i 1
if #x = 7
set #x 0
set #y #y + 1
end_if
if #y = 7
set #y 0
return
end_if
set lasttargetx charposx - 3 + #x
set lasttargety charposy - 3 + #y
set #tm %forestry.10[lasttargetx lasttargety]
set #x #x + 1
if #tm < 0
goto next
end_if
if #tm > 0
set laststatictype %forestry.10[lasttargetx lasttargety]
goto chop
end_if
set laststatictype %tree[#i]
:chop
send f11
waitfortarget
wait #wait
repeat 20
set timer
while lastmsg = $msg1
gosub emergency
wait 500
if timer > 10000
goto next
end_if
end_while
gosub emergency
if lastmsg = $msg2
set #i #i + 1
if #i > #ntree
set %forestry.10[lasttargetx lasttargety] -1
goto next
end_if
set laststatictype %tree[#i]
goto chop
end_if
if lastmsg = $msg3
goto next
end_if
if lastmsg = $msg4 or lastmsg = $msg5 or lastmsg = $msg10
if_not #tm > 0
gosub laststatictype
set #tm %forestry.10[lasttargetx lasttargety]
end_if
goto chop //If you don't want to collect logs
//for creating array only enter ''goto next'' instead
end_if
if lastmsg = $msg6
alarm
end_if
if lastmsg = $msg7
if_not #tm > 0
gosub laststatictype
set #tm %forestry.10[lasttargetx lasttargety]
end_if
goto next
end_if
if lastmsg = $msg9
wait 10000
goto chop
end_if
wait #wait
end_repeat
send escape
goto next
//All trees laststatictype data
:3277
set %forestry.10[lasttargetx lasttargety] 3277
return
:3280
set %forestry.10[lasttargetx lasttargety] 3280
return
:3283
set %forestry.10[lasttargetx lasttargety] 3283
return
:3286
set %forestry.10[lasttargetx lasttargety] 3286
return
:3288
set %forestry.10[lasttargetx lasttargety] 3288
return
:3289
set %forestry.10[lasttargetx lasttargety] 3289
return
:3290
set %forestry.10[lasttargetx lasttargety] 3290
return
:3293
set %forestry.10[lasttargetx lasttargety] 3293
return
:3296
set %forestry.10[lasttargetx lasttargety] 3296
return
:3299
set %forestry.10[lasttargetx lasttargety] 3299
return
:3302
set %forestry.10[lasttargetx lasttargety] 3302
return
:3395
set %forestry.10[lasttargetx lasttargety] 3395
return
:3417
set %forestry.10[lasttargetx lasttargety] 3417
return
:3440
set %forestry.10[lasttargetx lasttargety] 3440
return
:3461
set %forestry.10[lasttargetx lasttargety] 3461
return
//___Tune x position subprogram
:tunex
if_not #dx = 0
set #err #err + 2
say ; error
:tunex2
if #dx < 0
if_not chardir = 2
send pagedown
wait #wait
end_if
repeat -#dx
set #charx charposx
send pagedown
wait #wait
if #charx = charposx
send pagedown
wait #wait
end_if
end_repeat
end_if
if #dx > 0
if_not chardir = 6
send home
wait #wait
end_if
repeat #dx
set #charx charposx
send home
wait #wait
if #charx = charposx
send home
wait #wait
end_if
end_repeat
end_if
end_if
return
//___Tune y position subprogram
:tuney
if_not #dy = 0
say ; error
set #err #err + 2
:tuney2
if #dy < 0
if_not chardir = 4
send end
wait #wait
end_if
repeat -#dy
set #chary charposy
send end
wait #wait
if #chary = charposy
send end
wait #wait
end_if
end_repeat
end_if
if #dy > 0
if_not chardir = 0
send pageup
wait #wait
end_if
repeat #dy
set #chary charposy
send pageup
wait #wait
if #chary = charposy
send pageup
wait #wait
end_if
end_repeat
end_if
end_if
return
//___Speed autodetection
:speed
if #wait = 0
if_not $no = messages
msg Your speed autodetection
wait 500
end_if
if_not chardir = 0
send pageup
wait 2000
end_if
set #temp 50
set #maxwait 1
while_not #temp = 0
set #y charposy
send pageup
wait #wait
if charposy = #y
wait 2000
if #wait > #maxwait
set #maxwait #wait
end_if
set #wait #wait + 30
set #temp #temp + 15
if charposy = #y
continue
end_if
end_if
send end
wait #wait
if chardir = 0
wait 2000
if #wait > #maxwait
set #maxwait #wait
end_if
set #wait #wait + 30
set #temp #temp + 15
if #chard = 0
send end
wait 2000
end_if
end_if
set #y charposy
send end
wait #wait
if #y = charposy
wait 2000
if #wait > #maxwait
set #maxwait #wait
end_if
set #wait #wait + 30
set #temp #temp + 15
if #y = charposy
send end
wait 2000
end_if
end_if
send pageup
wait #wait
if chardir = 4
wait 2000
if #wait > #maxwait
set #maxwait #wait
end_if
set #wait #wait + 30
set #temp #temp + 15
if chardir = 4
send pageup
wait 2000
end_if
end_if
if #wait > #maxwait
set #wait #wait - 1
end_if
set #temp #temp - 1
if #temp > 50
set #temp 50
end_if
say low #maxwait high #wait turn #temp
end_while
set #wait #maxwait
if_not $no = messages
msg Your speed is #wait
wait 3000
end_if
end_if
set #maxwait #wait * 2
return
//______Train subprogram_______
:train
set %forestry.10[charposx charposy] -1
return
//_____Emergency subprogram______
:emergency
//All of this coords are given for
//640*480 resolution of inner UO window
//Correct them if you have other
//resolution. Get "standard backpack" and
//correct it colour. It used only for finding
//your hatchet after CL in this script, but
//I think you find a way to use it more effective :-)
if_not 515, 55 6504993 //Open backpack
send f8
wait 1000
end_if
if 320, 240 8094852 //CL window
set #ai 0
wait 10s
send enter
wait 10s
goto emergency
end_if
if 320, 300 7568251 //Log in to UO
send enter
wait 10s
goto emergency
end_if
if 320, 240 7568251 //Connecting...
wait 1m
if 320, 240 7568251 //Couldn't ???
send enter
wait 10s
end_if
goto emergency
end_if
if 320, 240 11386301 //Select shard
left 617 455 //Next button
wait 10s
left 617 455 //select char (1-st char?)
goto emergency
end_if
//if hits < #h
//alarm
//Place your invis + recoll macros there
//end_script
//end_if
//if wght > 420 //Enter your maxweight - 10 there
//Place your recoll macros there
//end_script
//end_if
return
//[End of file]
Ваши права
- Вы не можете создавать новые темы
- Вы не можете отвечать в темах
- Вы не можете прикреплять вложения
- Вы не можете редактировать свои сообщения
Правила форума
|