Log in

View Full Version : Timing before calling a procedure



CRASH_OVERRIDE
11-18-2012, 03:13 AM
Is their a simple way to have it so that:


If your character not moved for X amount of time then the specified procedure is ran?

to find X i guess its based on mousemovements? If character doesn't move mouse after X time than run the specified script.

I know i saw something like this somewhere on here... Where was it!....:duh:

NCDS
11-18-2012, 03:23 AM
var
t, x: integer;
begin
x := 10000; //or whatever time you want (in milliseconds)
t := getSystemTime + x;
//whatever code you want to run within the 'timer'
if getSystemTime > t then
//whatever code you want to run if the timer expires
end;


That help at all?

Rezozo
11-18-2012, 03:29 AM
Lol, plain and simple. Nice^^^
Tasmania, if you need any more help, just post k?

CRASH_OVERRIDE
11-18-2012, 04:12 AM
Cheers guys,

Heres where i am stuck,

my script walks to mithril and mines it until invfull then banks it. Works fine. Second part of script is walking to coal and mining it and when invfull walktobank and bank it. Again no problem...

This is the thing... Im not sure if i should somehow declare at the start if a person can choose to mine mith or coal. And i am not sure how to implement this.

Here is my script:

Its attached too big for forum again due to my paint. Also download the co_resource_dungeon.png and place it in /includes/sps/img/runescape_other/

Basically this is a resource dungeon miner/depositer. Abu's seems to not work and has too many errors for me to work out. I know the scripts a bit rough and could do with some work but this is my second script with PAINT and a CUSTOM MAP. And this is my second script within 24 hours of joining this group. I am starting to catch on. It is a shame i have 0 feedback on my other one: http://villavu.com/forum/showthread.php?t=92677 Wouldn't mind some advice...

Anyways if i can get some advice on how to add an option at the start of script where the client can choose either Mith or Coal. And once i learn that i am still going to have to wrok on these a lot lol. But its a good start.

And i have to say its pretty damn good. The bot can never get lost as its all included into each dtm :/

Who knows, maybe that map will be handy to others? It works like a charm for DTM walking.

http://i1260.photobucket.com/albums/ii575/burgo855/ReourceMiner.png

NCDS
11-18-2012, 04:24 AM
This is the thing... Im not sure if i should somehow declare at the start if a person can choose to mine mith or coal. And i am not sure how to implement this.

This could be done with a simple condition. Have users set a boolean in the players array (declarePlayers), then adjust your walking and object finding methods respectively.

Your scripts look very nice for only just joining here. I'm assuming you have prior programming experience? Expect to wait a while to get feedback on some of your scripts though, especially ones as common as a draynor cutter. Although, you were right, that is indeed a nice location for a first script. You are indeed doing well thus far. :)

Rezozo
11-18-2012, 04:24 AM
procedure DoIt;
Begin
if MithIt then
Begin
WalkToDepositBox;
BankInventory;
WalkToMithril;
MineMithril;
End;
if CoalIt then
Begin
WalkToDepositBox;
BankInventory;
WalkToCoal;
MineCoal;
End
End;
Begin //main execution
Repeat
DoIt;
Until(whatever)
End.


Please do not mind the tabbing, my phone is just that bad right now.

CRASH_OVERRIDE
11-18-2012, 05:22 AM
Well theirs a few games i know inside out and i know how to do some devious stuff as well. But in all honestly, this type of scripting is more fun than the game. I get no pleasure in using bots but its fun to make them:/

Thanks Rez, nice sig btw,

CRASH_OVERRIDE
11-18-2012, 05:36 AM
:(

ERROR using the above Rez:(

Unknown identifier 'MithIt'

Im assuming i need to declare it? Also wouldn't this just keep mining an inventory of mithril than an inventory of coal? over and over :/