SRL Archive - Help

bot is right clicking every monster


Slither1

2012-01-17 13:37:15

my bot is right clicking all monsters in pest control before selecting attack from the list

any ideas on how to fix this?

Dynamite

2012-01-17 13:41:02

Umm, post the code ;)

-Boom

Slither1

2012-01-17 13:45:47

umm i'm not sure what part would be useful, would it be to do with the script because its only started happening since the update

PatDuffy

2012-01-17 13:50:53

Oh darns, your script is broken and there's not a free version available anymore.

Your choices are either fix it yourself or stop using it.

Slither1

2012-01-17 13:55:41

yeah i know, i've managed to get it working except for this constant right clicking

okokokok

2012-01-17 13:57:25

From: Slither1
yeah i know, i've managed to get it working except for this constant right clicking


Post the whole script and ill edit it for you

PatDuffy

2012-01-17 14:04:27

From: okokokok
Post the whole script and ill edit it for you


Awh, don't do that…leachers will never learn to script if we keep feeding them what they want.

I edited the pest control script last night to work, it took me 2 edits of lines.

footballjds

2012-01-17 14:14:35

From: Slither1
my bot is right clicking all monsters in pest control before selecting attack from the list

any ideas on how to fix this?


aww, poor thing

Slither1

2012-01-17 14:19:09

i'm happy to learn if anyone wishes to give me a push in the right direction. I managed to get it working with SRL5 but I got stuck on this because im new to simba

footballjds

2012-01-17 14:21:52

From: Slither1
i'm happy to learn if anyone wishes to give me a push in the right direction. I managed to get it working with SRL5 but I got stuck on this because im new to simba


since the script is not public anymore(AFAIK)
Not too many people will likely help you… :P

okokokok

2012-01-17 14:22:01

From: PatDuffy
Awh, don't do that…leachers will never learn to script if we keep feeding them what they want.

I edited the pest control script last night to work, it took me 2 edits of lines.


He doesn't even know how to post the script

Slither1

2012-01-17 14:23:59

From: okokokok
He doesn't even know how to post the script


i know how to post the script but i would prefer to attempt to fix it myself instead of getting it fixed for me and not gaining anything from it

okokokok

2012-01-17 14:34:43

From: Slither1
i know how to post the script but i would prefer to attempt to fix it myself instead of getting it fixed for me and not gaining anything from it


You changed your mind fast

Slither1

2012-01-17 14:40:15

i've never asked for anyone to do it for me, i said from the start any ideas on how i could fix it.

i've currently managed to get it to stop right clicking but i know this would only be temporary by changing the MOUSE_RIGHT where it attacks the monsters to MOUSE_LEFT

begin
GetMousePos(StartX, StartY);
GMMouse(x, y, rx, ry);
GetMousePos(TargetX, TargetY);
if left then Button := MOUSE_LEFT
else Button := MOUSE_LEFT;
//else Button := MOUSE_RIGHT;
HoldMouse(TargetX, TargetY, Button);
Wait(25+Round(Gaussian(70, 2.3, True)));
if (Random(15) = 0) then
begin


anyone able to help me correct this?

Kasi

2012-01-17 16:21:39

just use Mouse(x, y, rx, ry, True) instead of hold mouse and change button to a boolean

wantonman

2012-01-17 16:34:51

post it ill help , that kid is being an asshole

PatDuffy

2012-01-17 16:40:40

From: wantonman
post it ill help , that kid is being an asshole


I'm not being an asshole, I'm simply stating the fact that if he wishes to use a script that was removed due to leaching, he should have to fix it himself.

Helping him would be like telling him how to add summoning to Flight's Nat Crafter…. and in my personal opinion it would be leaking Member's scripts.

wantonman

2012-01-17 16:45:48

I was not talking about you PATDUFFY!

Harry

2012-01-17 16:50:49

Anyone who posts or shares the script that's now SRL Members will be considered leaking and will be banned from the forums for a very long time.

Learn to fix it yourself, or don't use it.

Kasi

2012-01-17 17:39:39

From: wantonman
I was not talking about you PATDUFFY!


Quote people to avoid arguments :)

KeepBotting

2012-01-17 18:07:27

Find the procedure that tells the bot to click on the monster, it should look something like this:

Mouse(x, y, 0, 0, false);
ChooseOption('YourMonsterName');
end;

Change that one "false" to "true" and it will only right-click when necessary.

example:

Mouse(x, y, 0, 0, true); //the "false" has been changed to "true"
ChooseOption('YourMonsterName');
end;

Kyle Undefined

2012-01-17 18:08:34

From: KeepBotting
Find the procedure that tells the bot to click on the monster, it should look something like this:

Mouse(x, y, 0, 0, false);
ChooseOption('YourMonsterName');
end;

Change that one "false" to "true" and it will only right-click when necessary.

example:

Mouse(x, y, 0, 0, true); //the "false" has been changed to "true"
ChooseOption('YourMonsterName');
end;


That's for SRL 4, not SRL 5. SRL 5 is mouse_Right ;)

grats

2012-01-17 18:15:24

From: Slither1
i know how to post the script but i would prefer to attempt to fix it myself instead of getting it fixed for me and not gaining anything from it


I'm sure okokokok just wants the script

watch yohojo's tutorial videos, you'll get an idea of how to mess with things

KeepBotting

2012-01-17 18:16:42

From: Kyle Undefined
That's for SRL 4, not SRL 5. SRL 5 is mouse_Right ;)
Wow, I suck. So I just spent 3 hours learning how to script in SRL4?

Harry

2012-01-17 18:17:26

From: KeepBotting
Wow, I suck. So I just spent 3 hours learning how to script in SRL4?

It's basically the same thing.

Kyle Undefined

2012-01-17 18:18:43

All the knowledge you learned is still relevant, except for small changes.

ClickNorth(True) -> SRL_ANGLE_HIGH/SRL_ANGLE_LOW/SRL_ANGLE_NONE
Same goes for SetAngle(True);

Mouse() now uses mouse_Left for left clicking and mouse_Right for right click.

grats

2012-01-17 18:20:31

From: KeepBotting
Wow, I suck. So I just spent 3 hours learning how to script in SRL4?


stuff is named differently… does slightly different things

you'll be able to use srl5 functions just like you do srl4, they just do different things…

go through srl includes and read what different procedures and functions do

wantonman

2012-01-17 18:33:14

yeah if you learn how to script you learn how to script! yull be a mem in no time (*wink)

Harry

2012-01-17 18:34:41

From: wantonman
yeah if you learn how to script you learn how to script! yull be a mem in no time (*wink)

Stop being so butthurt you were temp banned for spamming the forums. It had nothing to do with your application.

Slither1

2012-01-17 19:24:58

thanks for the help, ill give it a try now :)

so i've attempted these methods and still no luck, it right clicks then chooses attack and repeats on the monster after each hit


this is the section I think is causing the problem
procedure GMouse(x, y, rx, ry: Integer; left: Boolean);
var
StartX, StartY, TargetX, TargetY, Button: Integer;
DeltaX, DeltaY: Integer;
Neliojuuri, K: Extended;
begin
GetMousePos(StartX, StartY);
GMMouse(x, y, rx, ry);
GetMousePos(TargetX, TargetY);
if left then Button := MOUSE_LEFT
else Button := MOUSE_LEFT;
//else Button := MOUSE_RIGHT;
HoldMouse(TargetX, TargetY, Button);
Wait(25+Round(Gaussian(70, 2.3, True)));
if (Random(15) = 0) then
begin
DeltaX := TargetX-StartX;
DeltaY := TargetY-StartY;
Neliojuuri := Sqrt(DeltaY*DeltaY+DeltaX*DeltaX);
if (Neliojuuri = 0) then MoveMouse(TargetX-1+Random(3), TargetY-1+Random(3))
else begin
K := 1.5/Neliojuuri;
MoveMouse(TargetX+Round((K*DeltaX)), TargetY+Round((K*DeltaY)));
end;
end;
Wait(25+Round(Gaussian(70, 2.3, True)));
ReleaseMouse(TargetX, TargetY, Button);
end;

Press Play

2012-01-17 23:57:50

From: PatDuffy
I edited the pest control script last night to work, it took me 2 edits of lines.

He's 100% right; it took me 2 lines to fix it too :) i would help, but I'd be leaking a member's script. I hope this gives some people out there the incentive to learn how to script :)

Slither1

2012-01-18 16:18:59

yeah that's cool, any chance you could give me any clues? just a pointer towards what is causing it