SRL Archive - General Botting Help

Question about the use of the mouse


Spaceblow

2014-07-31 08:19:06

Hey everyone, I'm new to this forum and I actually want to learn how to script rather than leeching someones hard work. Powerbot and all those bots are either very detectable or not thrustworthy so after a bit of research I've concluded that Simba is the best choice because of the very low ban rate and because of the pretty easy language compared to Java and such. I'm following The Mayor's Simplistic Beginners Guide To RS3 Scripting (link below).

I have a question about the mouse movements. When I try to make a very simple script, according to the information The Mayor gives in his guide, I don't get the result I want.

So when I do this:
program new;

procedure mouseTest();
begin
writeLn('The mouse is about to move');
wait(randomRange(1000, 3000));
mouse(1721, 435, MOUSE_MOVE);
writeLn('The mouse has moved');
end;

begin
clearDebug();
mouseTest();
end.
I get:
Exception in Script: Unknown declaration "mouse" at line 7, column 3

Line 7, column 3 refers to 'mouse'. So I understand there's something wrong with it but I don't know why because I used the same thing as The Mayor did in his guide but without any SMART stuff to open.


But when I use this (according to stuff I found on the villavu docs (link below)):
program new;

procedure mouseTest();
begin
writeLn('The mouse is about to move');
wait(randomRange(1000, 3000));
MoveMouse(1721, 435);
writeLn('The mouse has moved');
end;

begin
clearDebug();
mouseTest();
end.
Then it works just fine.

Does it mean I have to use different functions than stated in the villavu docs if I would want to use it for RS? If yes, are all these functions I would need for RS listed anywhere (in the same form like villlavu docs)? Because it's kind of confusing. I hope you guys understand my question and could help me. It's perhaps a very dumb question but I'm really new to this kind of stuff and from what I've read on the internet, this forum has a very friendly and helpful community and I hope you could prove it and help me a hand with this. :) Also sorry for my English as it's not my native language.


The Mayor's guide: villavu.com/forum/showthread.php?t=109161
Villavu docs: docs.villavu.com/simba/scriptref/mouseandkeyboard.html

NKN

2014-07-31 08:41:16

Mouse is a method in the SRL include.

You have to do {$i SRL-6/SRL.simba} or something along those lines.

Coh3n

2014-07-31 09:23:07

MoveMouse is a Simba function and is the farthest thing from a human-like movement, while like NKN said, mouse() is an SRL function and is the one you want to use. You need to include SRL in your script if you want to utilize SRL functions. You also need to call setupSRL() at the begging of your mainloop.


program new;
{$i SRL-6/srl.simba}

procedure mouseTest();
begin
writeLn('The mouse is about to move');
wait(randomRange(1000, 3000));
mouse(1721, 435, MOUSE_MOVE);
writeLn('The mouse has moved');
end;

begin
clearDebug();
setupSRL();
mouseTest();
end.

Spaceblow

2014-08-01 08:24:41

So I would always need to begin my script with the following if I would want to use it for RS3:
program new;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}

And always begin my main loop with:
begin
clearDebug();
setupSRL();

Right?


After a little bit of googling I found the docs for SRL-6 (link below), I couldn't find it on this forum. So basically, everything I would ever need for RS scripting is included in the SRL-6 docs? Thanks in advance! I already like this forum a lot because of the pretty quick replies and because you guys answer pretty neutral on my stupid questions instead of trolling me or such.


docs.villavu.com/srl-6/

Coh3n

2014-08-01 08:42:46

From: Spaceblow
So I would always need to begin my script with the following if I would want to use it for RS3:
program new;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}

And always begin my main loop with:
begin
clearDebug();
setupSRL();

Right?
Yes, although you don't HAVE to use SMART. It's recommended, though, especially if you're just starting out. :)

From: Spaceblow

After a little bit of googling I found the docs for SRL-6 (link below), I couldn't find it on this forum. So basically, everything I would ever need for RS scripting is included in the SRL-6 docs? Thanks in advance! I already like this forum a lot because of the pretty quick replies and because you guys answer pretty neutral on my stupid questions instead of trolling me or such.


docs.villavu.com/srl-6/
Yeah those docs should be everything you need; however, it's possible some parts are outdated as some people forget to update the documentation if a function is altered, added, or removed. In addition to the documentation, you can use Simba's function list to see what functions are available in SRL-6.

I know I include the documentation link in my scripting guide, but I don't know if @The Mayor; does. A link should probably be included the scripting help section as well as the SRL development section, so I'll add that to my to do list.

Spaceblow

2014-08-01 09:05:07

I'm definitely going to use SMART because I would want to minimize the window so I could do other things too. And I'm probably going to follow The Mayor's guide because that one is for RS3 and yours is unfortunately for OSRS.

Thank you very much, you've been a great help to me, everything is a lot more clear now! I hope you don't mind topics with some obvious questions because I will probably be making some in the future when I'm on my learning path to writing a good script. :)

Coh3n

2014-08-01 10:33:08

From: Spaceblow
I'm definitely going to use SMART because I would want to minimize the window so I could do other things too. And I'm probably going to follow The Mayor's guide because that one is for RS3 and yours is unfortunately for OSRS.

Thank you very much, you've been a great help to me, everything is a lot more clear now! I hope you don't mind topics with some obvious questions because I will probably be making some in the future when I'm on my learning path to writing a good script. :)
I have a beginner guide for RS3; however, The Mayor's was written more recently and actually uses some RS examples. Mine is just the basics of programming with Simba (not necessarily for RS). If you have any other questions, feel free to contact me. :)

Spaceblow

2014-08-01 10:56:19

Alright, I understand, I'll probably check out all those different guides on this forum to really get into scripting. Thank you very much, you're very helpful! :)