SRL Archive - First Scripts

WTF is wrong with this script!


jdmzak

2012-01-13 15:31:09

okay, i have been out of the whole scar scripting thing ever since reflection came around, i decided to come back and use simba as it seems to be the very same as scar but much more supported these days. anyways to my point… WTF is wrong with this. it logs you in juts fine, does the antiban and anti randoms, but it will not cast, or select the correct spells. it click on the zombies but wont stun. anyone with scripting knowledge please help me :))



program MageGuildStunAlcher;
{$define srl5}
{$loadlib sps}
{$define smart}
{$i srl/srl.simba}
{$i sps/sps.simba}
{$i srl/srl/skill/fighting.simba}
{$i srl/srl/skill/magic.simba}


const
zomcol1 = 5601688; //may need to change these using the eye dropper..
zomcol2 = 3553336; //zomcol means zombie color.....
zomcol3 = 8423045;

var
X, Y :integer;
//////////////////////////////\PLAYER SETUP\////////////////////////////////////
procedure declareplayers; //Declareplayers
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := ''; //Username
Players[0].Pass := ''; //Password
Players[0].Nick := ''; //3-4 lower case letters of your username
Players[0].Active:= True; //is this player active?
end;
////////////////////////////////////////////////////////////////////////////////
//// NO MORE TOUCHING ///////////////////////////////////// NO MORE TOUCHING////
////////////////////////////////////////////////////////////////////////////////
Procedure Randoms; //randoms
begin
writeln('any randoms?');
FindNormalRandoms;
If Not(LoggedIn) Then
begin
WriteLn('Unsolvable random??');
LoginPlayer;
FindNormalRandoms;
If Not(LoggedIn) Then
begin
WriteLn('Client has Logged Out, Failed a Random? Stopping Scrip...');
TerminateScript;
writeln('Script may need human assistance at this point');
end
end;
end;
Procedure Antiban;
begin
writeln('Bored Human');
if not LoggedIn then Exit;
case Random(99) of
0: begin
wait(1526);
PickUpMouse;
SetAngle(SRL_ANGLE_HIGH);
end;
1: begin
RandomMovement;
SetAngle(SRL_ANGLE_HIGH);
end;
3: PickUpMouse;
4:begin
wait(2413)
pickupmouse;
wait(518)
randommovement;
end;
end;
end;
//Borrowed, cut, screwed from a few scripts.....
Function FindObjectFX(colors: TIntegerArray; Uptext: TStringArray; X1, Y1, X2, Y2, Width, Height, tol: integer; Click: Boolean): Boolean;
var
X, Y, I: integer;
TPA: TPointArray;
ATPA: T2DPointArray;

begin
SetLength(TPA, Length(Colors));

For I:= 0 To High(Colors) do
FindColorsSpiralTolerance(MSCX, MSCY, TPA, Colors[i], X1, Y1, X2, Y2, tol);

ATPA:= TPAToATPAEx(TPA, Width, Height);
SortATPAFrom(ATPA, Point(MSCX, MSCY));
if(Length(ATPA) = 0) then
Exit;

MiddleTPAEx(ATPA[0], X, Y);
if Click then
MMouse(x, y, 5, 5);

Wait(randomrange(200, 500));
If(IsUpTextMultiCustom(UpText)) then
begin
if Click then
begin
ClickMouse2(False);
wait(500);
if ChooseOptionMulti(UpText) then
begin
Result := True;
Exit;
end;
end else
Result := True
end else
Result:= (((X <> 0) and (Y <> 0)) and (Click = False)) ;
end;
function ClickZom(Colors: TIntegerArray; Tol, TimeOut: Integer): Boolean;
var
x, y:integer;
begin
if (not LoggedIn) then exit;
if FindObjectFX(Colors, ['ttack', 'mbie', 'zomb'], MSX1, MSY1, MSX2, MSY2, 10, 10, Tol, True) then
cast('stun',false);
mouse(x,y,3,3,true);
end;
procedure ClickClickBoom;
begin
wait(RandomRange(236, 561));
if clickzom([zomcol1,zomcol2,zomcol3],5,1000) then
cast('high level alchemy', false);
Antiban;
end;




begin //main
cleardebug;
Smart_Server := 11;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
SetupSRL;
cleardebug;
writeln(' ') ;
writeln(' ') ;
writeln('JDMzaks Mage_Guild_Stun_Alcher') ;
writeln(' Version 1') ;
writeln('****FEEDBACK MAKES BETTER SCRIPTS****') ;
writeln(' ') ;
writeln(' ') ;
declareplayers;
LoginPlayer;
wait(1500);
SetAngle(SRL_ANGLE_HIGH);


repeat //main loop
Randoms;
ClickClickBoom;
until(false)
end.

jelle013

2012-01-13 16:36:20

hey i need zombie color codes they wont work for me ;s
ill try your codes

kevin33

2012-01-13 16:46:33

I would suggest making DTMs for the spells so it know what to look for.

JN13

2012-01-13 16:59:56

stun is difficult to dtm sometimes, i had some problems with it, i advise a bitmap for stun.

footballjds

2012-01-13 17:01:41

From: johnnimms13
stun is difficult to dtm sometimes, i had some problems with it, i advise a bitmap for stun.


bitmaps are only "easier" because you can raise the tolerance as high as needed.

DTM's are not only faster they're faster.

A simple GetColor(x, y); would be plenty if each person has the same spell book setup.
Otherwise i'd suggest a DTM.

JN13

2012-01-13 17:46:20

good to know :)