Danizho
2010-06-10 00:48:18
My first Simba Script
[PHP]
program new;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl\srl\Skill\Fighting.scar}
const //smart setup
SmartWorld = 15; // Which World/Server do you want to use?
SmartMembers = False; // Is it a Members World?
SmartSigned = True; // Signed/UnSigned Client?
SmartSuperDetail = False;
TheSkill = 0 ;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1 ;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with players[0] do
begin
Name := '';
Pass := '';
Active := True;
Pin := '';
Strings[TheSkill] := 'Fishing'; //The skill you want to level up with a lamp
BoxRewards := ['Lamp'];
end;
end;
Procedure DoSomethingElse;
begin
MMouse(800, 800, 0, 0);
Wait(RandomRange(1000, 5000));
end;
//426 range animation
Procedure AntiBan;
begin
Case Random(50) of
0..19 : DoSomethingElse;
20..25 : DoSomethingElse;
26..30 : BoredHuman;
31..40 : Wait (RandomRange(1000, 5000));
41..50 : HoverSkill('random', False);
end;
if FindNormalRandoms then
begin
UseRewardBox;
FindLamp(Players[CurrentPlayer].Strings[TheSkill]);
end;
end;
procedure FindTheNPC;
var
NPCC: TNPC;
OurPoint: TPoint;
begin
If(FindNPC('Zombie',NPCC))then //Zombies…
begin
writeln('Found the monster');
OurPoint := TileToMS(NPCC.Tile, Random(5));
writeln('Attackin…!');
mouse(OurPoint.x,OurPoint.y,2,2,true);
Wait(RandomRange(1000, 5000));
Antiban;
end;
end;
//Something Fighter Procedure //
procedure HpCheck;
var
c, T, i, x, y:Integer;
RunDir: String;
begin
if (HPPercent < 50) and LoggedIn then
begin
Writeln('HP low doing HP checks…');
if not InvEmpty then
for c := 0 to 2 do
begin
for i := 1 to 28 do
if ExistsItem(i) then
begin
MMouseItem(i);
GetMousePos(x, y);
if WaitUptext('Eat', 400) then
begin
Mouse(x,y,0,0,false);
if WaitOption('Eat', 400) then
if (HPPercent > 50) then
Exit;
end;
end;
if (not LoggedIn) or (HPPercent > 50) then
Exit;
end;
if (HPPercent < 50) then
begin
if (HPPercent < 25) then
if (InFight) then
begin
RunDir := 'nsewns';
Writeln('Running away HP% < 25…');
RunAway(RunDir[random(6)+1], true, 1, 10000 + random(2000));
end;
T := GetSystemTime;
repeat
Wait(200+random(200));
FindNormalRandoms;
If ((GetSystemTime - T) > (50000+random(30000)) ) then
begin
case random(2) of
0: BoredHuman;
1: DoSomethingElse;
end;
T := GetSystemTime;
end;
if not LoggedIn then
Exit;
until (HPPercent > 50);
SetAngle(true);
end;
end;
end;
Procedure SetupPlayer;
begin
SetAngle(True);
end;
begin
Smart_Server := SmartWorld;
Smart_Members := SmartMembers;
Smart_Signed := SmartSigned;
Smart_SuperDetail := SmartSuperDetail;
SetupSRL;
SetupReflectionEx(True);
DeclarePlayers;
LoginPlayer;
FindTheNPC;
repeat FindTheNPC
until(False);
end.[/PHP]
any opinions. critics, etc … and, a help with failsafe (its hard to understand) the ranging animation is 426 … but i cant make a good failsafe if the click fails
This is my first step on the long SRL/SImba road
=) :garfield:
[PHP]
program new;
{$DEFINE SMART}
{$i srl\srl.scar}
{$i reflection\reflection.simba}
{$i srl\srl\Skill\Fighting.scar}
const //smart setup
SmartWorld = 15; // Which World/Server do you want to use?
SmartMembers = False; // Is it a Members World?
SmartSigned = True; // Signed/UnSigned Client?
SmartSuperDetail = False;
TheSkill = 0 ;
Procedure DeclarePlayers;
begin
HowManyPlayers := 1 ;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with players[0] do
begin
Name := '';
Pass := '';
Active := True;
Pin := '';
Strings[TheSkill] := 'Fishing'; //The skill you want to level up with a lamp
BoxRewards := ['Lamp'];
end;
end;
Procedure DoSomethingElse;
begin
MMouse(800, 800, 0, 0);
Wait(RandomRange(1000, 5000));
end;
//426 range animation
Procedure AntiBan;
begin
Case Random(50) of
0..19 : DoSomethingElse;
20..25 : DoSomethingElse;
26..30 : BoredHuman;
31..40 : Wait (RandomRange(1000, 5000));
41..50 : HoverSkill('random', False);
end;
if FindNormalRandoms then
begin
UseRewardBox;
FindLamp(Players[CurrentPlayer].Strings[TheSkill]);
end;
end;
procedure FindTheNPC;
var
NPCC: TNPC;
OurPoint: TPoint;
begin
If(FindNPC('Zombie',NPCC))then //Zombies…
begin
writeln('Found the monster');
OurPoint := TileToMS(NPCC.Tile, Random(5));
writeln('Attackin…!');
mouse(OurPoint.x,OurPoint.y,2,2,true);
Wait(RandomRange(1000, 5000));
Antiban;
end;
end;
//Something Fighter Procedure //
procedure HpCheck;
var
c, T, i, x, y:Integer;
RunDir: String;
begin
if (HPPercent < 50) and LoggedIn then
begin
Writeln('HP low doing HP checks…');
if not InvEmpty then
for c := 0 to 2 do
begin
for i := 1 to 28 do
if ExistsItem(i) then
begin
MMouseItem(i);
GetMousePos(x, y);
if WaitUptext('Eat', 400) then
begin
Mouse(x,y,0,0,false);
if WaitOption('Eat', 400) then
if (HPPercent > 50) then
Exit;
end;
end;
if (not LoggedIn) or (HPPercent > 50) then
Exit;
end;
if (HPPercent < 50) then
begin
if (HPPercent < 25) then
if (InFight) then
begin
RunDir := 'nsewns';
Writeln('Running away HP% < 25…');
RunAway(RunDir[random(6)+1], true, 1, 10000 + random(2000));
end;
T := GetSystemTime;
repeat
Wait(200+random(200));
FindNormalRandoms;
If ((GetSystemTime - T) > (50000+random(30000)) ) then
begin
case random(2) of
0: BoredHuman;
1: DoSomethingElse;
end;
T := GetSystemTime;
end;
if not LoggedIn then
Exit;
until (HPPercent > 50);
SetAngle(true);
end;
end;
end;
Procedure SetupPlayer;
begin
SetAngle(True);
end;
begin
Smart_Server := SmartWorld;
Smart_Members := SmartMembers;
Smart_Signed := SmartSigned;
Smart_SuperDetail := SmartSuperDetail;
SetupSRL;
SetupReflectionEx(True);
DeclarePlayers;
LoginPlayer;
FindTheNPC;
repeat FindTheNPC
until(False);
end.[/PHP]
any opinions. critics, etc … and, a help with failsafe (its hard to understand) the ranging animation is 426 … but i cant make a good failsafe if the click fails
This is my first step on the long SRL/SImba road
=) :garfield: