SRL Archive - OSR News and General

Need Help With 2007 Combat Script


bot2stake1

2013-02-26 16:30:19

Hi, I am trying to make my first script. What this script will do is attack a scorpion, and after 12 seconds it will find another scorpion and attack it. I do not know how to make the script tell if the scorpion is dead or not, so I just have it 12 seconds since that should be plenty of time for me to kill one.

Like I said this is my first script ever, and making is for 2007 has made it more difficult. It does not use SMART or have anti-ban.

I have managed to get the mouse to find the scorpions, but it will not click them. Here is what I have so far:
Program Attack;

{$I SRL/SRL.Simba}
{$I P07Include.Simba}

Procedure Attack;
var x, y: integer;
begin
repeat
if P07_FindObj(x, y, 'corpion', 3618629, 1) then
begin
Mouse(x, y, 3, 3, false);
P07_ChooseOptionMulti(['ttack']);
end;
repeat
wait(12000+random(250));
Until not IsUpText('corpion') or (InvFull);
until(InvFull);
end;

begin
SetUpSRL;
SetupP07Include;
Attack;
end.

Also, I used a tutorial on how to chop a tree, so that is why the loop will stop when the inventory is full. I didn't bother changing that in fear of messing something up, plus I will not be looting anything with the script so since the inventory will not fill up it shouldn't matter. At this point I am just trying to get the script to function.

marc2333

2013-02-26 17:47:17

Better not do that if its your first script. It will look like a bot and will have no randomness at all. An other thing is that you have no way to detect if the scorpion you are attacking is already fighting or not.

Combat bots needs to be a little bit more advanced..

For the loop, you can just put "false" and it will make it keep looping, not matter what.

bot2stake1

2013-02-26 18:17:26

Okay thanks. Any idea why it will not click on the scorpion? The mouse finds them but I cannot get it to click for the life of me… tried so many thing and can never get it to click

Piguhz

2013-02-26 19:52:49

Try somthing like this.
If P07_FindObjCustom(x, y, ['Attack', 'corpion'], [Insert, Colorcodes, here], 5) Then
ClickMouse2(mouse_left);
Good luck!

Zackeri

2013-02-26 19:54:20

From: Piguhz
Try somthing like this.
If P07_FindObjCustom(x, y, ['Attack', 'corpion'], [Insert, Colorcodes, here], 5) Then
ClickMouse2(mouse_left);
Good luck!


way to take that out of the chicken killer script