The lag i randomly experience is causing me to error out, or have incorect amounts for combination. So im trying to have it do an event, check to see if it happened, and if not, goback and try again to combat the lag. In the Sub AddItem it checks to see if the enviro slot whatever is true(has an item) if it does it picks it up, and puts it in the inventory, then does a recheck to make sure it worked. it then adds the corect item to the bag.. then goes back to recheck and if it didnt work it does it again.. the problem is it gets stuck in the first loop. I tell it to only execute the commands if slot whatever is true... then i have it print the TRUE or NULL status of that slot IN the conditional.. wich means it should always print true... but it prints null sometimes... for some reason that condition is executing for no reason..
if you try to run this since you dont have the ini for the run paths, you can delete that whole chunk of code and just buy those amounts of items to start with. then arrange all your bags so nothing overlaps, and change the /click left x y statement to wherever the "expirament" button is on your new tradeskill window.
also im having problems with the /click left enviro slot# statement.. it seems to be clicking a spot on the screen where the tradeskill bag isnt located... the bag can be moved to that spot and it works fine, but its a bit of a hassel.
any other ideas to handle for lag and errors are greatly apreciated
Code: Select all
|
| Need advpath.inc for this.
| having problems with the "/click left enviro bag#" doesnt seem to be clicking right spots
|
#turbo 50
#include advpath.inc
Sub Main
/declare Counter local
/call InitAPFVars 1 15 20
:MainLoop
/call delay 1s
/call GMcheck
/doevents
|| walks you to merchant 1, and buys 16stacks of water
/call PlayFunction "froty_to_glinya 1 cf nopp noz"
/call WaitTilThere
/target glinya
/click right target
/call delay 2s
/for Counter 1 to 16
/call BuyStack "Water Flask"
/next Counter
/press esc
|| walks you to merchant 2, buys 8 yeast stacks, 24 malt stacks
/call PlayFunction "froty_to_glinya 1 cr nopp noz"
/call WaitTilThere
/target frothy
/click right target
/call delay 2s
/for Counter 1 to 8
/call BuyStack "Yeast"
/next Counter
/for Counter 1 to 24
/call BuyStack "Malt"
/next Counter
/press esc
|| walks you to merchant 3, and brew barrel, buys 16 short beer, 8 casks
/call PlayFunction "froty_to_sam 1 cf nopp noz"
/call WaitTilThere
/target sam
/click right target
/call delay 2s
/for Counter 1 to 16
/call BuyStack "Short Beer"
/next Counter
/for Counter 1 to 8
/call BuyStack "Cask"
/next Counter
/press esc
|| opens barrel
/cleanup
/itemtarget Brew Barrel
/face item
/click left item
/doevent
/call delay 1s
/click left 800 250 || CLICKS THE EXPIRAMENT BUTTON ON NEW TS SKIN
/doevent
||Open up entire inventory
/press i
/for Counter 0 to 7
/call delay 2
/click right inventory @Counter
/next Counter
/doevent
||COMBINES THE CRAP
/for Counter 1 to 160
/call DoCombine
/doevent
/next Counter
/cleanup
/goto :MainLoop
/return
Sub WaitTilThere
:LoopTilThere
/if n @PathingFlag==1 {
/call AdvPathPoll
/call delay 0
/doevents
/goto :LoopTilThere
}
/return
Sub BuyStack(ItemName) ||BUYS A STACK OF WHATEVER U WANT
/sendkey down shift
/selectitem "@ItemName" merchant
/click left merchant buy
/call delay 3s
/sendkey up shift
/doevents
/return
Sub AddItem(ItemName,SlotNum) |drops the items
/ECHO $item(e,@SlotNum) $item(e,@SlotNum,name)
:recheck
/if "$item(e,@SlotNum)"=="TRUE" { |if there is something in the slot
/ECHO $item(e,@SlotNum) |THIS SHOULD ALWAYS PRINT TRUE, ITS ONLY EXECUTED IF ITS TRUE, BUT IT PRINTS NULL
/click left enviro @SlotNum | it takes it out and drops it in
/call delay 10 | the inventory, then rechecks in
/autoinventory | case of lag.
/call delay 10
/goto :recheck
/doevents
}
:readd
/finditem "Water Flask" |adds the item to bag
/click left enviro @SlotNum
/if "$item(e,@SlotNum,name)"!="@ItemName" { |makes sure the item is there
/call delay 10 |if not it retries
/goto :readd
/doevents
}
/doevents
/return
Sub DoCombine
||adds items to brew barrel, hits combine
/declare counter2 local
/doevents
/sendkey down ctrl
/call AddItem "Water Flask" 0
/call AddItem "Water Flask" 1
/call AddItem "Short Beer" 2
/call AddItem "Short Beer" 3
/call AddItem "Malt" 4
/call AddItem "Malt" 5
/call AddItem "Malt" 6
/call AddItem "Yeast" 7
/call AddItem "Cask" 8
/sendkey up ctrl
/varset counter2 0
:waitcombine
/click left enviro combine
/doevents
/if "$cursor()"=="TRUE" /goto :finishcombine
/goto :waitcombine
:finishcombine
/doevents
||no matter if your combine fails or works, you have 2 by products produced,
|| this clicks destroy till 2 items are destroyed
/varset counter2 0
:waitdestroy
/if "$cursor()"=="TRUE" {
/destroy
/varadd counter2 1
/doevents
}
/if n @counter2<2 /goto :waitdestroy
/doevents
/return
Sub GMCheck
/declare Counter local
/if $gm=="TRUE" {
/echo fuck
/beep
/beep
/beep
/press down down
/for Counter 0 to 9
/press esc
/next Counter
/if $char(state)!="SIT" /sit
/camp
/endmacro
}
/return 