SRL Archive - OSR Help

Bot doesn't Attack nor loot


Shorteh96

2013-03-06 23:32:23

program AIOFighter;
// I, Shorteh96, would like to thank the following users:
// RequiredOne: I used part of your AutoFighter script as backbone.
// Eduard: I used a lot of your Fight Cave script as backbone to convert to SMART.
// Ogre: Thank you for helping me with my remedial errors in the chatbox.

// I, Shorteh96, would like to take very little credit for this script
// as I have no idea how to code in all honesty but am capable of reading
// and copying premade code into a new working script. Thank you!

{$Define SMART}
{$i SRL/SRL.simba}
{$i P07Include.simba}
{$include SRL/SRL/Misc/SmartGraphics.simba}

var
x, y: Integer;
Combat1, num1, num2, attnum: Integer;

const

// REQUIRED CONFIGURATION BY USER:
FightStyle = 1; // 1 = Att, 2 = Str, 3 = Contr, 4 = Def
MNick = 'Oblin'; // Monster name without the first letter
MColor = 7184261; // Monster Color 1
MColor2 = 4486329; // Monster Color 2

// OPTIONAL CONFIGURATION BY USER
ABan1 = 'Attack'; // First skill for the anti-ban to check
ABan2 = 'Hitpoints'; // Second skill for the anti-ban to check
Loot = 'Bones'; // Loot name including the first letter
LColor = 10132390; // Color of the loot to pick up

procedure P07_DeclarePlayers;
begin
P07_PlayerName := ''; // Username for 07Scape
P07_PlayerPass := ''; // Password for 07Scape
end;
// END OF CONFIGURATION

procedure P07_SetRun(Run: Boolean);
var
x, y: integer;
begin
if not P07_TabInventoryTab(12) then
begin
writeln('ERROR: Could not P07_TabInventoryTab(12) -> Error in P07 include or random! Exiting');
Exit;
end;
if (FindColor(x, y, 4342852, 627, 416, 658, 444)) then
begin
writeln('-> Run = on!');

mouse(x, y, 1, 1, 1);
end;
writeln('-> Going to inventory tab');
P07_TabInventoryTab(4);
end;

procedure SetMeUp;
begin
writeln('-- Configuring player --');
writeln('-> Checking AutoRetaliate.');
P07_AutoRetaliate(true);
writeln('-> Checking CombatStance');
if(FightStyle = 0) then
begin
writeln('ERROR: Please fill in the FightStyle settings!');
TerminateScript;
end;
P07_CombatStance(FightStyle);
writeln('-> CombatStance = '+Inttostr(FightStyle)+'');
writeln('-> Making Compass South');
P07_MakeCompassSouth;
writeln('-> Making Camera Angle High');
P07_MakeCameraAngleHigh;
P07_SetRun(true);
writeln('-- Configuration completed --');
writeln('');
end;

procedure ProgressReport;
begin
Wait(5000);
cleardebug();
writeln('-- AIO Fighter Alpha 0.1 --');
writeln(' Time Running: '+TimeRunning+'');
end;

procedure Random1;
begin
attnum := (Random(1000));
end;

procedure Attack;
var x, y: Integer;
begin
wait(500 + random(800))
if P07_FindObjCustom(x,y, ['ttack', MNick], [MColor, MColor2], 5) then
begin
if combat1 = (0) then
begin
P07_MouseBox(X, Y, X, Y, mouse_left);
wait(random(500));
end;
end;
end;

procedure Combat;
begin
Combat1 := 1;
begin
if (FindColor(X, Y, 65280, 220, 110, 330, 220)) then
begin
WriteLn('Combatting mobs');
end
else Combat1 := 0;
if (FindColor(X, Y, 65280, 220, 110, 330, 220)) = false then
if Loot = ('') = false then
if P07_FindObjCustom(x,y, [Loot], [LColor], 5) then
begin
wait (randomrange(100, 200));
ClickMouse2(mouse_right);
wait(randomrange(800, 1000));
P07_ChooseOptionMulti(['balsl ' + Loot]);
end;
end;
end;

Procedure Antiban;
Begin
num2 := (5);
num1 := (random(30));
WriteLn(num1)
sleep(2000)
if num2 < num1 then
Case Random(10) Of
1: P07_HoverSkill(ABan1,RandomRange(2500,3500));
3: Boredhuman;
4: Wait(2500 + random(4500));
5: p07_HoverSkill(ABan2,RandomRange(2500,3500));
6: PickUpMouse;
7: RandomMovement;
8: RandomRClick;
9: P07_MakeCompassdegree(randomrange(0, 360));
end;
end;

begin
P07_DeclarePlayers;
SetupSRL();
SetupP07Include;
ClearDebug;
writeln('Hello, welcome to SMART AIO Fighter Alpha 0.1');
writeln('Please submit all bugs/troubles on the forum for fast fixes!');
writeln('');
if (not P07_LoggedIn) then
P07_LogInPlayer;
SetMeUp;
repeat
if (not P07_LoggedIn) then
begin
P07_LogInPlayer;
SetMeUp;
if combat1 = 0 then
Random1;
Combat;
if Combat1 = 0 then
Attack;
end;
Antiban;
progressreport;
wait(2000 + random(100));
until (false)
end.

The first, and major problem is that once the bot runs "SetMeUp" it continues to check Antiban and does not attack any monsters nor loot. I can not release without this being fixed.

The second, and miniscule in importance as the first is that the debug box of SIMBA is used as a time report for the script but random numbers appear on the third line while some times these numbers are gone:





Justin

2013-03-06 23:42:06

Seems like the colors are no longer valid. Re-select your colors and see how that goes.

Shorteh96

2013-03-06 23:45:35

From: Justin
Seems like the colors are no longer valid. Re-select your colors and see how that goes.


Thanks for the speedy reply, I want this solved ASAP. I just changed the colors to no avail unfortunately :(

Justin

2013-03-06 23:46:47

Does it move the mouse to the NPC?

Shorteh96

2013-03-06 23:47:17

From: Justin
Does it move the mouse to the NPC?


That is a no go, it does not.

tealc

2013-03-06 23:48:53

try 'Oblin'->'oblin'

the random number is caused by

WriteLn(num1)

Justin

2013-03-06 23:50:00

It could be a anti-leech, try posting on the script thread :)

Shorteh96

2013-03-06 23:50:52

From: tealc
try 'Oblin'->'oblin'


Ah, that didn't solve it but that is correct, it should be oblin. Thanks, still doesn't attack or hover over NPC's however.

From: Justin
It could be a anti-leech, try posting on the script thread :)


It isn't an anti-leech lul, I'm trying to make this script.

Shorteh96

2013-03-07 00:02:07

I really want help getting this solved, I'd pay someone $2.00 - $3.00 if they could fix it as I just don't want my efforts wasted.

Justin

2013-03-07 00:04:10

From: Shorteh96
I really want help getting this solved, I'd pay someone $2.00 - $3.00 if they could fix it as I just don't want my efforts wasted.


We don't accept payment for help, if you really want to donate, you can donate to villavu - http://villavu.com/forum/misc.php?do=donate

Shorteh96

2013-03-07 00:05:56

From: Justin
We don't accept payment for help, if you really want to donate, you can donate to villavu - http://villavu.com/forum/misc.php?do=donate


Gah, not as an incentive to whom ever can help me? I'm not trying to bribe anyone . . . just make it so someone doesn't put forth effort and not receive anything.

tealc

2013-03-07 00:49:53

found it you put the end; of an if statement in the wrong spot. change from this
if (not P07_LoggedIn) then
begin
P07_LogInPlayer;
SetMeUp;
if combat1 = 0 then
Random1;
Combat;
if Combat1 = 0 then
Attack;
end;

to this
if (not P07_LoggedIn) then
begin
P07_LogInPlayer;
SetMeUp;
end;
if combat1 = 0 then
Random1;
Combat;
if Combat1 = 0 then
Attack;


It now moves the mouse.

The Mayor

2013-03-07 01:13:53

Can you explain what this Procedure is for?

procedure Random1;
begin
attnum := (Random(1000));
end;