SRL Archive - OSR Help

Help with how to make a script walk to bank


garryd2011

2013-03-10 06:25:10

Right can anyone explaina what the parts in this code mean so i can learn please

P07_FFlag;
waitfunc(@ P07_NotMoving, 100, 20000);
wait(3000)
P07_FFlag;
Mouse(650, 25, 0, 0, True);
wait(3000);

Like break it down for me on how to get the numbers and what they are for

1. P07_FFlag; < what is this

2. waitfunc(@ P07_NotMoving, 100, 20000); what are these numbers

3. Mouse(650, 25, 0, 0, True); what are all these
^ ^ ^ ^ ^
^ ^

And also how do i finbd the numbers etc to change them from the coilours in game

wthomas

2013-03-10 06:43:36

If you hold shift and click on the function it should take you to the definition of that function so you can see whats going on in there.
If you try this on the P07_FFlag; procedure you can see that it is looping, doing nothing until the mini map flag has disappeared. So this function waits until the mini map flag has disappeared, i.e our character has walked to it.
The second one is sort of given away by its name waitfunc. It waits until a function returns true, in this fase it waits until the player is not moving, checking every 100 milliseconds and exiting after 20000 milliseconds (20seconds).

Which script did you take that snipped from, it looks far too familiar.

Finding the colors its best to use ACA as it gives a log of control over finding the correct tolerance, saturance and hue. Search the forums for a guide.

Runehack123

2013-03-10 06:50:16

P07_FFlag;
waitfunc(@ P07_NotMoving, 100, 20000);
wait(3000)
P07_FFlag;
Mouse(650, 25, 0, 0, True);
wait(3000);

1. P07_FFlag; < what is this
-> FFlag(Dist: Integer): Boolean; returns true when the flag is within distance defined by an integer value e.g. If FFlag(3) Then etc..
However, since the parameters aren't met here and the boolean result that it returns here is not used I don't get the point here. Blame the scripter ;)… Hmm now you can find more about this by typing in P07_FFlag; into the search bar in the bottom left of Simba (just above the debug box). You can also hold down the control key and then click on the function within your script to see its code and description. Often this comes with example code aswell!

2. waitfunc(@ P07_NotMoving, 100, 20000); what are these numbers
-> This checks if P07_NotMoving returns true every 100 milliseconds for 20000 milliseconds. Again, you can look at the function description with what I said above.

3. Mouse(650, 25, 0, 0, True); what are all these
^ ^ ^ ^ ^

This moves your mouse to the co-ordinates x - 650 and y - 25 with a random x offset of 0, a random y offset of 0 and then performs a left click (True is left click, false would be a right click. This can also be defined by integer values!). Hmmm, now then since you didn't know this really basic thing why not read/watch some tutorials? Here is the basics from YoHoJo http://www.youtube.com/watch?v=pMMejhyjGwI ..That will definitely help you get started. The scripting tutorial section on villavu has so many tutorials, too! See here -> http://villavu.com/forum/forumdisplay.php?f=490

And also how do i finbd the numbers etc to change them from the coilours in game
You can use the colour picker or ACA tool … watch the YoHoJo videos, read some beginner guides and you'll understand all about it in no time. :p

Best of luck.

Sjoe

2013-03-10 07:03:00

Where-ever u got it from, that guy how some epic coding lol

Runehack123

2013-03-10 07:11:44

From: Sjoekeloe
Where-ever u got it from, that guy how some epic coding lol

Sarcasm… (Might not be obvious to garryd2011 - being new to this)

wthomas

2013-03-11 05:35:23

From: Runehack123
Sarcasm… (Might not be obvious to garryd2011 - being new to this)


oi. <3 :p but yes, that snippet was very messy at the time.