SRL Archive - OSR Help

Script command help


rebeltjeh

2013-03-15 10:00:43

Hello guys,



I'm currently working on a superheat-miner.

Now for my mining function.

Currently I just use, if(findrock) => click => wait +- (time it takes to mine)



But now I want to upgrade that command to:

if(findrock) => click => if(lastfullinvslot+1 exists) (so if I got an extra item in my inventory) then => continu


This on it self is easy with P07 functions, BUT if somebody else would mine your ore, then my script would just get stuck, so I want:

both the 'if( inventoryslot exists" or (10sec passed) )" if one of those 2 is true it should go to the next rock.



But wait is not a bolean, so I do not know how to combine those 2, any suggestions?


(sorry for strange explination, I dont really know how to put it into words)

Greetings

Rebel

rebeltjeh

2013-03-15 10:15:49

nvm found a solution with repeat

Repeat
wait(1000)
until(slotexists)

so it waits 1 sec, checks if slot exists, waits another sec etc etc

riwu

2013-03-15 10:17:12

A common time out failsafe

MarkTime(t);
repeat
wait();
until (TimeFromMark(t) > xxx) or {ur other checks};

rebeltjeh

2013-03-15 10:21:58

Thanks for fast response.

Only just started really writing full scripts right now, been adjusting most of the time.