to zapisujemy jako .ng
Kod :
{wpt.walkerbyX inspired by mahamad, modified and added by xadi(test30)
v1.53 16III2009
->added machete using
v1.52 15III2009
->added talking with Maris npc
v1.51
->added random sleep delay between npc conversation
->first released to public withdraw items from depot variable, it lets you to withdraw X item from depot, when depositer goes to depot until Y cap is reached or Z amount of this item is in hands+arrows+backpacks, the syntax for this array is withdrawitemsfromdepot:=[[X,Y,Z],[X,Y,Z]]; for example withdrawitemsfromdepot:=[[3277,0,20],[3031,0,30]]; will always try to have 20amount of itemid3277 in visible spots and 30amount of 3031(gold)itemid, in shown examples cap is not presented, because i have not tested it so much, so i preffer using item-amount-reaching
v1.5
->released ab'dendriel trolls opener.
->improved key-door opening, you can hold you key in any opened backpack or in arrow slot
->improved getting place in depot for depositing items function
v1.42
->added longer delay after roping.
->fixed talking with npcs
v1.41
->openingbackpacks improved to be liek elfstyle. everybackpack from first opened container will be opened in separated window
v1.4
->modified talking with travel-npcs by adding loop, so if for example buddel will sail you to wrong place (the correct place is based on next waypoints) script will try to talk to him again about sailing.
->added withdrawitemsfromdepot which can withdraw for example spears from depot to backpack, where loot is. adding array [3277,50,100] will withdraw spears from depot until reached 50 cap OR 100 spears in first opened backpack, if there are not enough speras in depot, script will pause itself by showing message.
it can be used to refill food for example, lets say 1234 is food's id. [1234,10,30] will look for food while it is in depot until cap=10 or lower OR amount of food is above 30;
-array ammoids tells script which items is ammo, lets say you want to script equips spears after withdrawing them from depot, so you need to have 3277(spearid) and at least 1 spear in any of your hands
v1.32
->procedure checking is container full used in depositer now always will return a value
v1.31
->fixed reopenbpafterdp if choosed false
v1.3
->laguna island support, even with PUSHING players and moving items staying on turtle
->improved ramp detection, now not only Z-level change makes it reached, but big teleportations too
->added bigger delay between reopening backpacks
v1.2
->npc traveling
v1.11
->added item stacker in depo
->no more BP-2 reopening backpack problem
->fixed a little shoveling
->fixed ramp reaching
v1.0 beta
->first release to the public:
+useful variables such as
|def_capacity-> below this character's capacity script in nearest execution will go to depo, it is in 'every depositer'
|
+items2dp->depositing items to depo with
|script will check is depot available, if it is not, it will try to open another, if there is not free depot, it will wait until someone leaves and it will continue depositing procedure, simple, isn't it?
|advanced choosing the best position in depo to item be stacked with, for example, if you have in your bp 1200gps in gold coins, and script opens depo and it sees there is pile with 1gp and 2gp, it droops 100gp on this 1gp what makes another 1gp is first item in bp, next turn drops 100gp on this 2gp, so it makes first items in backpack are 2gp,1gp, there is no chance of fast-wasting backpacks
|automatically opening next backpacks in depo, automatically looking for free space there
+pause(scroll lock key)
|for example, if you are being attacked by pk while script is running, simply press [Scroll lock key] which is mostly to the left from famous pause|break key and depositer will get paused in way which can be resumed by simply reclicking scrolllock
+waypoint scrolling keys[pageup/pagedown]
|if you want to back to waypoint which you were going to in previous turn press pagedown, if you want to skip waypoints to not waste time of waiting, press pageup
+def_delta->first used in depositers variable delta it is simple and useful!
|if you got delta=5 and script is executed while having 15 items in backpack, which has 20 maximum-items-in, delta of first opened backpack equals to 20-15=5 and it is >=5, so if you got 15 or more items in first opened backpack script will go to depo
+improved shoveling
|full support for normal shovel and light shovel
|if hole is hidden, for example tombs, it will try to pick it many times, but not in infinity.
|if there is rubish on hole it will move it under your feet so bot can simply use shovel on hole, not on rubbish
+sever gate using included in script, no more having problem with edron-gobs depositer
+full support for elvenhair rope and normal rope
+reopenbpafterdp->backpack reopener
|lets say you are hunting turtles and you want to script leave isle when 20cap, average amount of gp is then like 8k~=4bps of cash, after you will back to island you will have only last backpack ready for looting, so you need to reopen backpack by your own hands, this procedure lets you to script after depositing items reopen backpack
+def_attackmonsters->attacking controller, do you want to depositer attacks monsters? no problem, set it to 1, do you want depositer not to attack monsters? set it to 0, want to leave it without scripter decision? set it to 2
+depositer with withdrawer, why is it needed? lets say you want to deposit gold and items from Laguna Island with turtles, you need 50gp after depositing all to bank to get back to exp-spot, this depositer allows you to withdraw this cash to be able to travel there again and keep exping, tottaly afk can be left there and it will not stand in front of npc and wont keep saying hi>passage>yes
|procedure which checks is there bank npc, if there is not near you, script wont be executed
+included-in-depositer house depositer, why in depositer? where can i find it useful? for example in fibula, i have got ready setting for http://erig.net/house/MORGANA/FibulaVillage4 house, and script it 100% working, tested it well by creating many 50lvls knights
|items may be even dropped by the window
+100% support for door opening, fibula houseORThaisDepo-depositer makes no more difficult
|100% support for ab'trolls door opening, ability of opening seal'quest' doors, for example nomad cave in Darama
This script is capable of doing EVERYTHING. Even if now no, in future - yes.
} const {configcststart}
def_capacity=60; def_delta=0; def_attackmonsters=1; {configcstend}
df=0; ca=1; fh=4; bm=['Briasol','Ebenizer','Eva','Ferks','Jefrey','Muzir','Paulie','Rokyn','Suzy','Tesha','Tezila','Znozel','Jessica']; ci=[452,431,563,419] fm=[453,430,564,420] bv=[3277,7378,1781,3031]; di=100; bn=0; dm='' var items2dp,goifz,et,withdrawitemsfromdepot:array;delta,capacity,da,index:integer; dw,bq,dodepo,reopenbpafterdp:boolean;waypoints,by{ae for displaytext},fg:string; bf,fi:boolean;attackmonsters,fe:byte;ez:integer; cs:array;
function bp(fn,cx : integer):integer; var x,y:integer; begin updateworld; result:=0; for y:=0 to self.containers.count-1 do if y=cx then for x:=self.containers.container[y].count-1 downto 0 do if self.containers.container[y].item[x].id=fn then begin if self.containers.container[y].item[x].properties.pilable then result:=result+self.containers.container[y].item[x].amount; else result:=result+1; end end;
procedure az; begin {configvarstart}
items2dp:=[[3073,''], [3073,''], [5921,'hblossom'], [5922,''], [3061,'lcrystal'], [3357,'plate armor'], [3350,''], [3037,'yellow gem'], [3082,'elvenamulet'], [3038,''], [3285,'longsword'], [3031,'gold'], [3042,'scarab coin'], [3033,'small amethyst'], [3032,'small emer'], [1781,'sml stones'], [3560,''], [3403,''], [647,'seeds'], [3298,''], [3347,''], [3560,''], [3347,''], [3403,''], [3269,''], [3052,''], [7457,''], [7379,''], [5913,''], [5911,''], [3344,''], [7449,''], [7290,''], [7463,''], [3358,''], [3367,''], [3266,''], [3354,''], [7461,''], [3352,''], [3377,''], [7462,''], [3027,'Black Pearl'], [5875,'ADDONS START HERE'], [5876,''], [5877,''], [5878,''], [5879,''], [5880,''], [5881,''], [5882,''], [5883,''], [5890,''], [5893,''], [5894,''], [5895,''], [5896,''], [5897,''], [5898,''], [5899,''], [5902,'honey comb'], [5904,''], [5905,''], [5906,''], [5909,''], [5911,''], [5912,''], [5913,''], [5914,''], [5919,''], [5920,''], [5921,''], [5922,''], [5925,''], [5930,''], [5954,''], [5948,''], [3560,''], [6097,''], [6098,''], [6126,''], [7290,'ADDONS END'], [3429,'black shield'], [3027,'bl pearl'], [5809,''], [3007,'i think crystal ring'], [3052,'lifering']]; {cd, cw, cr} withdrawitemsfromdepot:=[[nil,0,0]]; reopenbpafterdp:=false; goifz:=[8]; {configvarend}
end;
function bi:integer begin result:=0; for x:=1 to length(fg) do if (fg[x]=' ') then inc(result); if ((result mod 4) <> 0) then result:=((result div 4)+1) else result:=result div 4; end;
function cq(bh:string;count:integer):integer; var bo: integer begin bo:=vararraycreate([0, count-1, 0, 3], $C); y:=0;x:=0; bg:=''; ag:=false; for fu:=1 to length(fg) do begin if y>3 then begin y:=0; inc(x);end if (fu=length(fg)) and (fg[length(fg)]<>' ') then begin ag:=true; bg:=bg+fg[fu];end if (fg[fu]=' ') or (ag) then begin if (x=0) and (y=0) then if strtoint(bg)>60000 then fi:=true else fi:=false if not fi then bo[x,y]:=bg else bo[x,y]:=inttostr(((strtoint(bg)-10)/3)) inc(y); bg:=''; end else bg:=bg+fg[fu]; end result:=bo end;
function aq(x, y, z: integer): ttile; begin result := nil; if abs((self.x - 7) - x) > 14 then exit; if abs((self.y - 5) - y) > 11 then exit; if self.z <> z then exit; result := screen.tile[abs((self.x - 7) - x), abs((self.y - 5) - y)]; end;
function eh:boolean; begin result:=true; if (low(withdrawitemsfromdepot)=high(withdrawitemsfromdepot)) and (withdrawitemsfromdepot[0][0]=nil) then result:=false; end
function ct(x,y,z,ds:integer); begin if ds>110 then ds:=110 updateworld; result:=false; if (abs(self.x-x)<=ds) and (abs(self.y-y)<=ds) then result:=true; end
function ey(tile: ttile): boolean; begin result := true; for x:=0 to tile.count-1 do if tile.item[x] then if not tile.item[x].properties.walkable then result:=false end;
function cz(tile:ttile):boolean begin result:=true for x:=tile.count-1 downto 0 do if tile.item[x] then if tile.item[x].properties.movable then begin result:=false tile.item[x].movetoground(self.x,self.y,self.z,0) sleep(100) break; end end
function ad(x,y,z:integer):boolean var tile:ttile begin if not ct(x,y,z,5) then exit tile:=aq(x,y,z) bw:=0 repeat inc(bw) updateworld sleep(100) until cz(tile) or terminated or (bw>100) bw:=0 repeat inc(bw) updateworld sleep(100) self.righthand.usewithground(x,y,z) sleep(100) self.lefthand.usewithground(x,y,z) sleep(100) until ey(aq(x,y,z)) or terminated or (bw>100) end
function dv(x,y,z:integer):byte; var bw:integer; br:byte; fc,fp,fv:integer; eu:boolean; begin bw:=0; br:=0; repeat updateworld; if bw=0 then begin fc:=self.x;fp:=self.y;fv:=self.z; end self.moveto(x,y,z); sleep(200); updateworld; self.displaytext(bw); if (fc<>self.x) or (fp<>self.y) or (self.z<>fv) then eu:=true else eu:=false; if eu then bw:=0 else inc(bw); updateworld; if (bw>60) then br:=1; if ((self.x=x) and (self.y=y) and (self.z=z)) then br:=2; until br<>0 or terminated; result:=br; end
function dg:boolean; var tile:ttile; em:boolean; x,y,fu:integer; cy:boolean; begin cy:=false; result:=false; tile:=screen.tile[7,5]; for fu:=tile.count-1 downto 0 do for ac:=low(fm) to high(fm) do if tile.item[fu].id=fm[ac] then begin cy:=true; self.displaytext('INFO_: already on dp'); break; end ef:=0 if not cy then repeat for x:=-7 to 7 do for y:=-5 to 5 do begin tile:=screen.tile[x+7,y+5]; for fu:=0 to tile.count-1 do for ex:=low(ci) to high(ci) do begin if tile.count>fu then if tile.item[fu] then if (not cy) and (tile.item[fu].id=ci[ex]) then begin ec:=self.x+x;af:=self.y+y;de:=self.z; if dv(ec,af,de)=2 then begin cy:=true; break; exit end end end end inc(ef) until terminated or (ef>5) result:=cy; end
function fo(id,cx:integer):integer begin result:=0; if self.lefthand.id=id then result:=result+self.lefthand.amount; if self.righthand.id=id then result:=result+self.righthand.amount; result:=result+bp(id,cx);end
function fq(eo:integer):boolean; var cg,fu,x,y:integer; begin updateworld; result:=true; if not eh then exit; for fu:=low(withdrawitemsfromdepot) to high(withdrawitemsfromdepot) do begin if withdrawitemsfromdepot[fu][1]>0 then if self.capacity>withdrawitemsfromdepot[fu][1] then begin result:=false; exit; end; if fo(withdrawitemsfromdepot[fu][0],0)<withdrawitemsfromdepot[fu][2] then begin result:=false; exit; end; end; end
function dp(cx:integer):titem; var y,x,fu,count:integer; begin count:=0; result:=nil; updateworld; for y:=0 to self.containers.count-1 do if (cx>=0) then begin if (y<>cx) then for x:=0 to self.containers.container[y].count-1 do begin for fu:=low(items2dp) to high(items2dp) do if (self.containers.container[y].item[x].id=items2dp[fu][0]) then if not self.containers.container[y].item[x].properties.container then begin result:=self.containers.container[y].item[x]; exit end end end else if y=abs(cx) then begin for x:=0 to self.containers.container[y].count-1 do begin for fu:=low(withdrawitemsfromdepot) to high(withdrawitemsfromdepot) do begin if self.containers.container[y].item[x] then if (self.containers.container[y].item[x].id=withdrawitemsfromdepot[fu][0]) then if not self.containers.container[y].item[x].properties.container then if fo(self.containers.container[y].item[x].id,0)<withdrawitemsfromdepot[fu][2] then begin result:=self.containers.container[y].item[x]; sleep(10); exit end end end end end
function bt(y,id:integer):boolean; var x:integer; begin result:=0 updateworld; if self.containers.container[y] then for x:=self.containers.container[y].count-1 downto 0 do if (self.containers.container[y].item[x].id=id) then if self.containers.container[y].item[x].properties.pilable then if self.containers.container[y].item[x].amount<100 then result:=result+1; if result<=1 then result:=0; end;
function ap(ay,y:byte):boolean; var c:integer; begin result:=false; c:=0; for x:=self.containers.container[y].count-1 downto 0 do if (ay<>x) then if self.containers.container[y].item[ay] then if self.containers.container[y].item[x] then if (self.containers.container[y].item[x].id=self.containers.container[y].item[ay].id) then if (self.containers.container[y].item[x].properties.pilable) then if bt(y,self.containers.container[y].item[x].id) then if (self.containers.container[y].item[x].amount<100) then begin inc(c); self.containers.container[y].item[ay].movetocontainer(self.containers.container[y],x,0); sleep(300); result:=true; exit end result:=false; end
function cc:boolean; begin result:=false for y:=self.containers.count-1 downto 0 do if not result then for x:=0 to self.containers.container[y].count-1 do if ap(x,y) then begin result:=true; exit end else result:=false end
procedure dx; repeat updateworld fw:=cc; sleep(100) until (terminated) or (not fw)
function fd(id,av:integer):integer; begin for x:=self.containers.container[av].count-1 downto 0 do begin if self.containers.container[av].item[x].id=id then if self.containers.container[av].item[x].amount<>100 then begin result:=x; exit; end; end for x:=0 to self.containers.container[av].count-1 do if not self.containers.container[av].item[x].properties.container then if not self.containers.container[av].item[x].properties.pilable then begin result:=x; exit; end end
function ej(index:integer):boolean; begin result:=false if self.containers.container[index] then begin if self.containers.container[index].capacity=self.containers.container[index].count then result:=true end end
procedure bx; var x,y:integer; begin repeat updateworld for y:=self.containers.count-1 downto 0 do begin self.containers.container[y].close sleep(900) end updateworld; if self.backpack then self.backpack.open; sleep(900) updateworld until (self.containers.count=1) and (self.containers.container[0]<>nil) sleep(100+di); updateworld; if not self.containers.container[0] then showmessage('ERROR_: there is no backpack opened, something went wrong'); for x:=0 to self.containers.container[0].count-1 do if self.containers.container[0].item[x] then if self.containers.container[0].item[x].properties.container then begin self.containers.container[0].item[x].openinnewwindow(); sleep(500+di); end end
function es(index:integer):boolean; var x,y:integer;item:titem; begin result:=false begin updateworld item:=dp(index) if index>=0 then begin if ej(index) then begin result:=false; exit; end; end else begin index:=0; end if (item<>nil) then begin if index=0 then bu:=1; else bu:=0; item.movetocontainer(self.containers.container[index],fd(item.id,index),bu) result:=true; sleep(di+100); exit; end end end;
function ek(y,en:integer;ep:string):boolean; var x,ch,dt:byte; begin result:=true if terminated or (y=0) then exit; if ep='d' then ch:=abs(y) else if ep='w' then ch:=-abs(y); repeat sleep(10+di); updateworld; if not es(ch) then break; if fq(abs(ch)) and (ep='w') then break; until terminated; updateworld begin sleep(100); updateworld; if bn then if not self.containers.container[y] then showmessage('ERROR_: something went wrong with '+ep+', maybe ping, this is prevention from your dieing'); for x:=0 to self.containers.container[y].count-1 do if self.containers.container[y] then if self.containers.container[y].item[x] then if self.containers.container[y].item[x].properties.container then begin updateworld; fx:=((ep='w') and fq(y)) or ((ep='d') and (dp(ch)=nil)); if fx then exit; self.containers.container[y].item[x].open; sleep(di+200); if fx then result:=false; else ek(y,en+1,ep); updateworld; if self.containers.container[y] then begin self.containers.container[y].openparent; sleep(500+di); end; if fx then exit; updateworld; end; end end { { sleep(200+di); updateworld; fx:=fq(abs(ch)); begin result:=false; if not ek(y,en+1,ep) then begin self.containers.container[y].openparent; exit; end end updateworld; sleep(150);}
procedure event_containeropened(index, id: integer; name: string); begin case ez of 309: if (ansilowercase(name)='locker') or ((id>=3495) and (id<=3550)) then begin y:=index begin updateworld; if self.containers.container[y] then fe:=y ez:=0; end end end end;
function dn:byte; var tile:ttile;cj:byte; begin result:=0; for x:=-1 to 1 do for y:=-1 to 1 do begin if screen.tile[7+x,5+y].item[screen.tile[7+x,5+y].count-1].properties.depot then begin repeat ez:=309; updateworld cj:=self.containers.count; screen.tile[7+x,5+y].item[screen.tile[7+x,5+y].count-1].open; sleep(500+di);updateworld; until terminated or (cj<=self.containers.count) or (ez=0) result:=self.containers.count-1; exit end end end
procedure ax; var x,y,fu:integer;ee:boolean;an:titem; begin repeat updateworld; ee:=false; an:=nil; for y:=self.containers.count-1 downto 0 do if not ee then for x:=self.containers.container[y].count-1 downto 0 do if not ee then for fu:=low(bv) to high(bv) do if self.containers.container[y].item[x] then if self.containers.container[y].item[x].id=bv[fu] then begin if (self.righthand.id=bv[fu]) or (self.righthand.id=0) then an:=self.righthand; else if (self.lefthand.id=bv[fu]) or (self.lefthand.id=0) then an:=self.lefthand; if an<>nil then if an.amount<100 then begin self.containers.container[y].item[x].movetobody(an,1); ee:=true; sleep(100); break; end end sleep(10); until terminated or (not ee); end
procedure co; var x,y,fu:integer;aj:boolean begin repeat aj:=false; for y:=-1 to 1 do if not aj then for x:=-1 to 1 do if not aj then for fu:=screen.tile[7+x,5+y].count-1 downto 0 do if screen.tile[7+x,5+y].item[fu] then if screen.tile[7+x,5+y].item[fu].properties.movable then begin screen.tile[7+x,5+y].item[fu].movetoground(self.x,self.y,self.z,0); sleep(100+di); aj:=true; break; end until terminated or (not aj) end
procedure al; begin fb:=0 dg ek(dn,0,'d'); ek(dn,0,'w'); if fe=0 then exit; if eh then begin begin for fu:=low(withdrawitemsfromdepot) to high(withdrawitemsfromdepot) do begin count:=fo(withdrawitemsfromdepot[fu][0],0); if count<withdrawitemsfromdepot[fu][2] then showmessage('ERROR_: there is amount='+inttostr(count)+' id='+inttostr(withdrawitemsfromdepot[fu][0])+'; it is not enough, there should be '+inttostr(withdrawitemsfromdepot[fu][2])+' of it'+chr(13)+chr(10)+'Anyway, if you click this [OK] script will continue hunting normally.'); end end; ax; dx; end; if reopenbpafterdp then bx; fe:=0; end
function am(cu, db, cl: string; dd: integer): boolean; begin updateworld; result := false; case dd of 1: if (strtoint(cl) = self.z + 1) then result := true; 2: if abs(strtoint(cl) - self.z)= 1 then result := true; 3: if (strtoint(cl) = self.z) then result := true; 4: if (strtoint(cl) = self.z) then result := true; 5: if (strtoint(cl) = self.z) then result := true; 6: if ((strtoint(cu) = self.x) and (strtoint(db) = self.y) and (strtoint(cl) = self.z)) then result := true; 7: if (strtoint(cl) = self.z) then result := true; 8: if ((strtoint(cl) - self.z)<>0) or (not ct(strtoint(cu),strtoint(db),strtoint(cl),30)) then result := true else result:=false; 80: begin self.say(inttostr(dd)+inttostr(strtoint(cl) - self.z));result:=false; sleep(1000) end else result := true; end; end;
function moveto(x,y,z: integer):boolean; begin updateworld; if (z<>self.z) or (not ct(x,y,z,550)) then dw := true else self.moveto(x,y,z); end;
procedure dq(x,y,z: integer); begin if z <> self.z then dw := true else begin self.containers.useitemwithground(3003, x, y, z); self.containers.useitemwithground(646, x, y, z); end if ct(x,y,z,5) then sleep(2000); end;
procedure dr(x,y,z: integer); var tile: ttile; bw:integer begin updateworld; bw:=0; if (z = self.z) and (abs(x-self.x)<=7) and (abs(y-self.y)<=5) then repeat begin tile := aq(x, y, z); tile.item[1].use; inc(bw) if tile.count>2 then begin sleep(100);tile.item[2].use; end sleep(100) end until (self.z=z) or (bw>100) or dw; else dw := true; sleep(2000); end;
procedure dz(x,y,z: integer); var tile: ttile ai:integer; bz:array begin if ct(x,y,z,120) then begin bz:=[x,y+1,z] bw:=0; repeat ai:=0; self.displaytext('INFO_: shoveling'); self.moveto(bz[0], bz[1], bz[2]); sleep(100) repeat updateworld; tile := aq(x, y, z); if tile then if tile.count then if not tile.item[tile.count-1].properties.movable then if not ((self.x=x) and (self.y=y) and (self.z=z)) then begin self.containers.useitemwithground(5710, x, y, z); self.containers.useitemwithground(3457, x, y, z); sleep(700);inc(ai) end updateworld; tile := aq(x, y, z); if tile then if tile.count then if tile.item[tile.count-1].properties.hole then break else if tile.item[tile.count-1].properties.movable then tile.item[tile.count-1].movetoground(self.x,self.y,self.z,0); sleep(300) until ((self.z<>z) or (terminated) or (ai>5)) sleep(100) cg:=0; repeat moveto(x, y, z); inc(cg) sleep(100) until (cg>10) or terminated; inc(bw) sleep(1000) until (self.z<>bz[2]) or terminated or (bw>5) end else dw := true; end;
procedure event_keydown(key:integer); begin case key of 145:bq:=not bq; 33:if index<da-1 then begin inc(index);by:='wptwalker INFO_> waypoint increased to '+inttostr(index);end 34:if index>0 then begin dec(index);by:='wptwalker INFO_> waypoint decreased to '+inttostr(index);end end end;
function ea(id: integer): tcreature; var x: integer; begin result := nil; for x := 0 to creatures.count - 1 do begin if x >= creatures.count then break; if creatures.creature[x].id = id then begin result := creatures.creature[x]; exit; end; end; end;
procedure event_attacked(id: integer); var creature:tcreature; if attackmonsters then begin if not bq then if not self.attacking then begin creature:=ea(id); if creature then if creature.npc and attackmonsters then if ((abs(creature.x-self.x)<2) and (abs(creature.y-self.y)<2) ) then creature.attacking:=true else creature.attacking:=false;end end
function er(x:integer):string;case x of1: result:='rope';2: result:='ladder';3: result:='upstairs';4: result:='downstairs';5: result:='hole';6: result:='ground';7: result:='shovel';8: result:='ramp';9: result:='sleep';10: result:='script';else result:='other';end;
function cb(id: integer): titem; var x: integer; y: integer; begin result := nil; for x := 0 to self.containers.count - 1 do begin if x >= self.containers.count then break; for y := 0 to self.containers.container[x].count - 1 do begin if y >= self.containers.container[x].count then break; if self.containers.container[x].item[y].id = id then begin result := self.containers.container[x].item[y]; exit; end; end; end; end;
function dh(id:integer):titem; var item:titem; begin if self.righthand.id=id then result:=self.righthand else if self.lefthand.id=id then result:=self.lefthand else if self.arrow.id=id then result:=self.arrow else result:=cb(id); end
procedure bl(cm,el,bj,id:integer); var tile:ttile; key:titem; while (not terminated) do begin updateworld; key:=dh(id); if (abs(self.x-cm)>7) or (abs(self.y-el)>5) or self.z<>bj then exit; tile := aq(cm,el,bj); if tile=nil then exit; if tile then if tile.item[1] then if tile.item[1].properties then if tile.item[1].properties.walkable then begin self.displaytext('wptwalker.keyopener INFO_: door opened');exit; end if tile <> nil then if tile.count > 1 then if tile.item[1].properties.door then if not tile.item[1].properties.walkable then begin key.usewithground(cm,el,self.z) end sleep(900); self.displaytext('wptwalker.keyopener INFO_: opening door'); sleep(100); end
procedure bs(dd:byte); var tile:ttile;cm,el,bj:integer; begin updateworld; case dd of 0:begin cm:=self.x;el:=self.y-1;bj:=self.z; end 1:begin cm:=self.x+1;el:=self.y;bj:=self.z; end 2:begin cm:=self.x;el:=self.y+1;bj:=self.z; end 3:begin cm:=self.x-1;el:=self.y;bj:=self.z; end end; while (not terminated) do begin updateworld; tile := aq(cm,el,bj); if not tile then exit; if not (tile.count>1) then exit; if not tile.item[1] then exit; if not tile.item[1].properties.door then exit; if tile.item[1].properties.walkable then begin self.displaytext('wptwalker.dooropener INFO_: door opened');exit; end else self.displaytext('wptwalker.dooropener INFO_: opening....'); if tile <> nil then if tile.count > 1 then if tile.item[1].properties.door then if not tile.item[1].properties.walkable then begin tile.item[1].use; end sleep(1000); end; end;
function ar:boolean; var x,y,ed:integer; name:string; begin result:=false; ed:=4; for y:=low(bm) to high(bm) do for x:=0 to creatures.count-1 do begin if creatures.creature[x].name=bm[y] then if abs(creatures.creature[x].x-self.x)<=ed then if abs(creatures.creature[x].y-self.y)<=ed then if creatures.creature[x].z=self.z then result:=true; end end
procedure ak(dl:integer); var dc,fl:integer; ew:boolean;bw:integer; begin bw:=0; eg:=0; updateworld; if not ar then exit; ew:=false; dc:=self.capacity; fk:=[self.x,self.y,self.z]; repeat sleep(random(1000,3000)); self.npcsay('hi'); sleep(200); sleep(random(1000,3000)); self.npcsay('deposit all'); sleep(200); sleep(random(1000,3000)); self.npcsay('yes'); writelog('C:\depositerbyxadi.txt',self.name+','+datetostr(now)+' '+timetostr(now)+', depogld'); sleep(100); sleep(random(1000,3000)); self.containers.useitemwithself(3031); sleep(600);sleep(random(1000,3000)); processevents; if eg=0 then ew:=true; sleep(1000);sleep(random(1000,3000)); if dl<>0 then begin self.npcsay('withdraw '+inttostr(dl)); sleep(1100);sleep(random(1000,3000)); self.npcsay('yes');sleep(random(1000,3000));self.npcsay('yes');sleep(random(1000,3000)); end self.npcsay('balance'); updateworld; inc(bw); if (dc<>self.capacity) or (fk[0]<>self.x) or (fk[1]<>self.y) or (fk[2]<>self.z) or (eg=0) then ew:=true; if not ew then sleep(5000); until ew or terminated or (bw>fh); sleep(100); updateworld if reopenbpafterdp then begin bx; bx; end; end;
procedure dk(name:string;cn:string); var bg:string;be:boolean;cg:integer;cp:byte; begin cp:=0; repeat inc(cp); self.displaytext('wpt.walkerbyx.INFO_: talking with npc '+name+'.'); be:=false updateworld for x:=0 to creatures.count-1 do if ansilowercase(creatures.creature[x].name)=ansilowercase(name) then begin creatures.creature[x].following:=true if ct(creatures.creature[x].x,creatures.creature[x].y,creatures.creature[x].z,7) then be:=true cg:=0; repeat sleep(1000); inc(cg) updateworld; until ct(creatures.creature[x].x,creatures.creature[x].y,creatures.creature[x].z,3) or terminated or (cg>30); end if index>0 then if ct(cs[0],cs[1],cs[2],2) then be:=true bd:=''; cf:='' if not be then continue for x:=1 to length(cn) do if (ord(cn[x])>=48) and (ord(cn[x])<=57) then begin cf:=cf+cn[x]; continue; end else if (ord(cn[x])=32) and (cf<>'') then begin bd:=bd+chr(strtoint(cf)) cf:='' continue end else if cn[x]='n' then begin self.npcsay(bd) bd:='' cf:='' sleep(500) continue end sleep(1000); until (ansilowercase(name)<>'buddel') or ct(et[index+1,0],et[index+1,1],et[index+1,2],8) or terminated; end
procedure fj; var eq,ay,ep,bw:integer ff:boolean; tile:ttile; begin if index<=0 then exit; ff:=false eq:=et[index-1,0] ay:=et[index-1,1]-1; ep:=et[index-1,2] if not ct(eq,ay,ep,7) then exit repeat updateworld tile:=aq(eq,ay,ep) du:=true for x:=tile.count-1 downto 0 do begin if tile.item[x] then if tile.item[x].properties.movable then begin tile.item[x].movetoground(eq,ay-1,ep,0); du:=false; end end inc(bw) if du then for x:=0 to creatures.count-1 do if creatures.creature[x].x=eq then if creatures.creature[x].y=ay then if creatures.creature[x].z=ep then if not ff then begin creatures.creature[x].moveto(eq,ay-1,ep); sleep(2000) self.moveto(eq,ay,ep); sleep(100) updateworld; ff:=((self.x=eq) and (self.y=ay) and (self.z=ep)) end self.moveto(eq,ay,ep); sleep(10) ff:=((self.x=eq) and (self.y=ay) and (self.z=ep)) until (bw>10) or ff or terminated; end
function bc(dy: string): integer; var fu: integer; ab: textfile; begin fu := 0 ab:=nil; assignfile(ab, dy); reset(ab); while not eof(ab) do begin cv:= readln(ab); fu := fu+1; end; closefile(ab); result:= (fu/4); end;
function eb(dy: string; count: integer): integer; var bo: integer ab: textfile begin bo := vararraycreate([0, count - 1, 0, 3], $C); assignfile(ab, dy); reset(ab); for fu:=0 to count-1 do begin bo[fu,0] := readln(ab); bo[fu,1] := readln(ab); bo[fu,2] := readln(ab); bo[fu,3] := strtoint(readln(ab)); end; closefile(ab); result := bo; end;
function ck:boolean; var x,y:integer;ft:titem; begin for x:=-1 to 1 do for y:=-1 to 1 do for z:=screen.tile[7+x,5+y].count-1 downto 0 do if screen.tile[7+x,5+y].item[z].id=3696 then begin if self.arrow.id=3308 then ft:=self.arrow else if self.righthand.id=3308 then ft:=self.righthand else if self.lefthand.id=3308 then ft:=self.lefthand else ft:=cb(3308) if ft<>nil then ft.usewithground(self.x+x,self.y+y,self.z); sleep(1000); end end
procedure ev(cu, db, cl: string; dd: integer); begin updateworld; if (attackmonsters=1) and (self.attacking<>nil) then exit; case dd of 1: dq(strtoint(cu), strtoint(db), strtoint(cl)); 2: dr(strtoint(cu),strtoint(db), strtoint(cl)); 3: moveto(strtoint(cu), strtoint(db)+1, strtoint(cl)+1); 4: moveto(strtoint(cu), strtoint(db)-1, strtoint(cl)-1); 5: moveto(strtoint(cu), strtoint(db), strtoint(cl)-1); 6: moveto(strtoint(cu), strtoint(db), strtoint(cl)); 7: dz(strtoint(cu), strtoint(db), strtoint(cl)-1); 8: moveto(strtoint(cu), strtoint(db), strtoint(cl)); 9: if (strtoint(cu)>=31000) and (strtoint(cu)<32000) then ak(strtoint(cu) mod 1000) else case strtoint(cu) of 309: al; 310:begin ak(0); end; 525:fj; 600:dk('Svenson', '104 105 n 116 105 98 105 97 n 121 101 115 n') 601:dk('Nielson', '104 105 n 102 111 108 100 97 n 121 101 115 n') 603:dk('Sebastian', '104 105 n 108 105 98 101 114 116 121 32 98 97 121 n 121 101 115 n') 604:dk('Captain Waverider', '104 105 n 112 101 103 108 101 103 n 121 101 115 n') 682:dk('Buddel', '104 105 n 112 97 115 115 97 103 101 n 115 118 97 114 103 114 111 110 100 n 121 101 115 n') 685:dk('Buddel', '104 105 n 112 97 115 115 97 103 101 n 116 121 114 115 117 110 103 n 121 101 115 n') 689:dk('Buddel', '104 105 n 112 97 115 115 97 103 101 n 111 107 111 108 110 105 114 n 121 101 115 n') 683:dk('Buddel', '104 105 n 112 97 115 115 97 103 101 n 99 97 109 112 n 121 101 115 n') 686:dk('Buddel', '104 105 n 112 97 115 115 97 103 101 n 104 101 108 104 101 105 109 n 121 101 115 n') 617:dk('Maris', '104 105 n 121 97 108 97 104 97 114 n 121 101 115 n'); 618:dk('Maris', '104 105 n 102 101 110 114 111 99 107 n 121 101 115 n'); 713:ck(); 311:bl(32655,31655,9,2969); 312:bl(32658,31645,9,2969); 313:bl(32190,32432,8,2968); 300:bs(0); 301:bs(1); 302:bs(2); 303:bs(3); 350:ad(self.x,self.y-1,self.z) 351:ad(self.x+1,self.y,self.z) 352:ad(self.x,self.y+1,self.z) 353:ad(self.x-1,self.y,self.z) else sleep(strtoint(cu) * 1000); end else moveto(strtoint(cu), strtoint(db), strtoint(cl)); end; end;
function fs(bk:string):integer; var aw, dj, fr, bb:integer; begin decodetime(now, aw, dj, fr, bb); result := aw * 60 * 60 + dj * 60 + fr ; end;
procedure au;begin self.moveup(); sleep(100);self.movedown(); sleep(100);self.moveright(); sleep(100);self.moveleft(); sleep(100); end
function at(z:byte):boolean; var x:integer; begin updateworld; result:=false; for x:=low(goifz) to high(goifz) do if goifz[x]=z then result:=true; end begin ce:=dm; da:=0; index:=0; dw:=false; bq:=false; if ce<>'' then begin da:=bc(ce); et := eb(ce, da); end else begin fg:='32621 31790 6 6 32622 31790 6 8 32641 31718 7 6 32641 31712 7 6 32655 31681 7 6 32654 31675 8 4 32655 31675 8 6 32655 31666 8 6 32649 31665 8 6 32638 31668 8 6 310 0 0 9 32638 31668 8 6 32654 31665 8 6 32670 31664 8 6 32673 31664 8 6 32681 31680 8 6 32682 31687 8 6 309 0 0 9 32682 31687 8 6 32682 31685 8 2 32682 31687 7 6 32666 31695 7 6 32656 31674 7 5 32642 31707 7 6 32638 31757 7 6 32624 31788 7 6 32623 31790 7 6 32622 31790 7 6 32621 31790 6 6 '; da:=bi; et:=cq(fg,da); end; ao:=[0,0,0,0]; fa:=0; ez:=0; aa:=0; cs:=[nil,nil,nil,nil]; withdrawitemsfromdepot:=[[nil,0,0]]; by:=''; delta:=0; dodepo:=false; goifz:=[nil]; attackmonsters:=2; items2dp:=[[nil,'']] updateworld; az if not dodepo then begin if at(self.z) then dodepo:=true; if ca<>0 then for ah:=low(et) to high(et) do if strtoint(et[ah,3])=6 then begin if at(et[ah,2]) then dodepo:=false; break; end; end; if def_capacity>0 then capacity:=def_capacity; if def_attackmonsters<>2 then attackmonsters:=def_attackmonsters; if def_delta>0 then delta:=def_delta; if (df<>0) and ((abs(self.x-et[0,0])>60) or (abs(self.y-et[0,1])>60)) then dodepo:=true; if self.capacity <= capacity then dodepo:=true; if self.containers.count>0 then if abs(self.containers.container[0].capacity-self.containers.container[0].count)<=delta then dodepo:=true; if not dodepo then exit; while (index<da) and (not terminated) do begin if (aa>20) or (by[1]='I') then begin by:=''; aa:=0;end updateworld; processevents; ba:=fs(timetostr(now)); if by='' then by:='INDX[pgdn/up]:'+inttostr(index)+ '; PSD[pause]'+inttostr(bq)+'; repeats:'+inttostr(fa)+'; type: '+er(et[index,3]); self.displaytext(by); inc(aa); if not bq then begin if (attackmonsters<>1) then ev(et[index,0],et[index,1],et[index,2],et[index,3]) else if (self.attacking=nil) then ev(et[index,0],et[index,1],et[index,2],et[index,3]) if am(et[index,0],et[index,1],et[index,2],et[index,3]) or dw or (not ct(et[index,0],et[index,1],et[index,2],250)) or (fa>20) then begin dw:=false; inc(index); fa:=0;end if self.attacking=0 then begin if abs(ba-ao[3])>1 then if (self.x=ao[0]) and (self.y=ao[1]) and (self.z=ao[2]) then inc(fa) else begin ao[0]:=self.x;ao[1]:=self.y;ao[2]:=self.z; ao[3]:=ba; fa:=0; end end end sleep(100); if index>0 then cs:=[et[index-1,0],et[index-1,1],et[index-1,2],et[index-1,3]]; end self.displaytext('wpt.walker_: finished successfuly'); end {
Kod :
32623
31789
7
6
32624
31797
7
6
32616
31813
7
6
32611
31829
7
6
32602
31838
7
6
32601
31838
7
8
32586
31854
6
6
32576
31855
6
6
32560
31840
6
6
32547
31834
6
8
32546
31834
5
6
32546
31839
5
6
32553
31843
5
6
32545
31848
5
6
32543
31843
5
6
32546
31833
5
6
32541
31831
5
6
32543
31831
5
6
32547
31834
5
8
32548
31834
6
6
32550
31825
6
6
32542
31821
6
6
32526
31827
6
6
32512
31839
6
8
32511
31839
7
6
32511
31834
7
6
32526
31818
7
6
32542
31816
7
6
32558
31821
7
6
32559
31821
7
6
32575
31807
7
6
32576
31797
7
1
32575
31798
6
6
32575
31801
6
6
32569
31802
6
6
32563
31786
6
6
32563
31784
6
6
32572
31784
6
6
32588
31788
6
6
32592
31791
6
6
32595
31790
6
6
32595
31792
7
5
32608
31778
8
5
32607
31778
8
6
32603
31783
8
6
32602
31782
9
5
32599
31785
9
6
32596
31769
9
6
32596
31760
9
6
32596
31764
9
6
32596
31757
9
6
32596
31773
9
6
32596
31780
9
6
32596
31779
9
6
32598
31779
9
6
32602
31782
9
2
32607
31783
8
6
32608
31778
8
1
32607
31779
7
6
32605
31779
7
6
32593
31782
7
2
32577
31788
6
6
32576
31788
6
6
32563
31784
6
6
32563
31790
6
6
32575
31801
6
6
32576
31797
7
5
32576
31808
7
6
32560
31818
7
6
32545
31821
7
6
32531
31816
7
6
32515
31830
7
6
32511
31839
7
6
32512
31839
7
8
32516
31839
6
6
32532
31824
6
6
32537
31809
6
6
32536
31809
6
6
32537
31809
6
6
32536
31809
6
6
32537
31793
6
6
32537
31788
6
6
32536
31786
6
6
32552
31774
6
6
32567
31765
6
6
32582
31766
6
6
32596
31763
6
6
32612
31774
6
6
32621
31790
6
6
32622
31790
6
8
32623
31790
7
6
Możecie to rozpracować ? Sam chyba wiem jak to działa, ale nie mam jak tego sprawdzić w tej chwili.
Zakładki