SRL Archive - OSR Help

Loot?


wrob

2013-03-22 00:19:20

Can anyone make this script loot iron arrows?

program iCombatSMART;
{$DEFINE SMART8}
{$i srl/srl.simba}
{$i P07Include.simba}
Var
camera2,camera1,Fighting,X,Y:Integer;

Procedure P07_DeclarePlayer;
begin
P07_PlayerName:='username';
P07_PlayerPass:='password';
end;
procedure RotateCamera;
begin
P07_MakeCompassdegree(randomrange(0, 360));
end;
procedure CameraRotate;
begin
camera1 := 2;
camera2 := (random(5));
if camera2 = camera1 then
RotateCamera;
end;
procedure AmIFighting;
begin
Fighting := 0;
begin
if (FindColor(X,Y,65280,220,110,330,220)) Then
begin
Fighting := 1
wait(2700+random(250));
end;
end;
end;
procedure AttackMonster;
begin
if P07_FindObjCustom(x,y, ['ttack', 'cow'], [3689556,3028806,5797788,4477798], 10) then
begin
P07_MouseBox(X, Y, X, Y, mouse_right);
wait(300+random(60));
P07_ChooseOptionMulti(['ttack']);
sleep(2000+random(250));
end;
end;
begin
P07_DeclarePlayer;
SetupSRL;
SetupP07Include;
ActivateClient;
ClearDebug;
if (not P07_LoggedIn) then
P07_LogInPlayer;
P07_MakeCameraAngleHigh;
if (P07_LoggedIn) then
begin
repeat
AmIFighting;
AttackMonster;
sleep(2500+random(100));
CameraRotate;
until(false);
end;

end.

Thanks!

kyleinkman

2013-03-22 00:29:26

hey welcome to the site, check out the tutorials section and give it a try yourself, after you post your attempt ill help you

wrob

2013-03-22 00:38:11

Hi, thanks! I've given it a try but I can't select the color of the arrow because when I click 'Pick a color' from Simba, I can't choose a color from the SMART game window.

kyleinkman

2013-03-22 00:41:17

try running ACA to get your colors, and disable the smart window when your picking the colors, here ill help you with the color
1456982 with a tolerance of 12

wrob

2013-03-22 01:26:07

I tried this but it still won't loot iron arrows. Any ideas?

program iCombatSMART;
{$DEFINE SMART8}
{$i srl/srl.simba}
{$i P07Include.simba}
Var
camera2,camera1,Fighting,X,Y:Integer;

[B]Const
Loot='Iron Arrow';
Color=1456982;[/B]

Procedure P07_DeclarePlayer;
begin
P07_PlayerName:='';
P07_PlayerPass:='';
end;
procedure RotateCamera;
begin
P07_MakeCompassdegree(randomrange(0, 360));
end;
procedure CameraRotate;
begin
camera1 := 2;
camera2 := (random(5));
if camera2 = camera1 then
RotateCamera;
end;

procedure AmIFighting;
begin
Fighting := 0;
begin
if (FindColor(X,Y,65280,220,110,330,220)) Then
begin
Fighting := 1
wait(2700+random(250));
end;
end;
end;
procedure AttackMonster;
begin
if P07_FindObjCustom(x,y, ['ttack', 'cow'], [3689556,3028806,5797788,4477798], 10) then
begin
P07_MouseBox(X, Y, X, Y, mouse_right);
wait(300+random(60));
P07_ChooseOptionMulti(['ttack']);
sleep(2000+random(250));
end;
end;

begin
P07_DeclarePlayer;
SetupSRL;
SetupP07Include;
ActivateClient;
ClearDebug;
if (not P07_LoggedIn) then
P07_LogInPlayer;
P07_MakeCameraAngleHigh;
if (P07_LoggedIn) then
begin

[B] if P07_FindObjCustom(x,y, [Loot], [Color], 1) then
begin
wait (randomrange(100, 200));
ClickMouse2(mouse_right);
wait(randomrange(800, 1000));
P07_ChooseOptionMulti([Loot]);
end;[/B]

repeat
AmIFighting;
AttackMonster;
sleep(2500+random(100));
CameraRotate;
until(false);
end;

end.

wrob

2013-03-22 04:32:48

I'm a real noob.

unregistered user

2013-03-22 12:31:31

The way you have it, the find and pick up arrows will only work when you start the script so its only going to find them 1 time which is before you even try killing a cow. Put it into your loop so that it finds them when the cow is dead. I would suggest making a procedure and put the name of the procedure into the loop.

hsxu

2013-03-22 12:33:44

You have the right idea. Place your bolded code at the bottom inside the repeat until false loop. I'm not sure if it will work then but that's where it belongs.

kyleinkman

2013-03-22 12:38:10

also is the uptext loot? or pick up, also you can left click instead of right clicking if the uptext matches