Simba Code:
program LDSex;
{$DEFINE SMART}
{$i SRL\SRL.scar}
{$i SRL\SRL\Misc\Debug.SCAR}
{$i SRL\SRL\Misc\Stats.simba}
{$i SRL\SRL\Skill\Magic.SCAR}
{$i SRL\SRL\Skill\Fighting.SCAR}
{
Spell Names:
'wind rush', 'wind strike', 'confuse', 'water strike', 'earth strike',
'weaken', 'fire strike', 'wind bolt', 'curse', 'bind',
'water bolt', 'earth bolt', 'fire bolt', 'crumble undead',
'wind blast', 'water blast', 'iban blast', 'snare',
'magic dart', 'earth blast', 'fire blast', 'saradomin strike',
'claws of guthix', 'flames of zamorak', 'wind wave',
'water wave', 'vulnerability', 'earth wave',
'enfeeble', 'fire wave', 'entangle', 'stun', 'charge',
'wind surge', 'teleport block', 'water surge', 'earth surge',
'fire surge'
}
Const
SRLStats_Username = '';// Your SRL Stats Username
SRLStats_Password = ''; // Your SRL Stats Password
BreakEvery = 120; //How Many Minutes To Break After
BreakFor = 10; //How Long To Break For
Version = '1.0b';
Procedure ProgressReport; Forward;
Var
StartTime: Integer;
TAttacks: Integer;
BreakCounter, SleepCounter, SleepMinutes, SleepTime, LastAttack: Integer;
procedure DeclarePlayers;
Var i:integer;
Begin
NumberOfPlayers(1);
CurrentPlayer := 0;
For I := 0 to (1-1) Do
Players[i].BoxRewards := ['mote', 'ostume', 'XP', 'Gem', 'ithril', 'oal', 'une', 'oins'];
With Players[0] Do
Begin
Name := ''; //Player username.
Pass := ''; //Player password.
Nick := 'zei'; //Player nickname - 3-4 letters of Player username.
Active := True;
Strings[0] :='Stun'; //Name of spellto cast.(See list of spells above)
End; //Set to 'Range' if ranging!
End;
Procedure StatsGuise(wat:String);
Begin
Status(wat);
Disguise(wat);
End;
Procedure Antiban;
Begin
Case Random(250) Of
0: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('Magic', False) GameTab(28) End;
1: Begin StatsGuise('AntiBan') SleepAndMoveMouse(7000 + Random(500)); End;
2: Begin StatsGuise('AntiBan') GameTab(tab_Inv) ExamineInv; GameTab(28); End;
3: Begin StatsGuise('AntiBan') RandomAngle(1); End;
4: Begin StatsGuise('AntiBan') GameTab(Tab_Stats); Wait(3000 + Random(500)); GameTab(28); End;
5: Begin StatsGuise('AntiBan') GameTab(tab_Stats) HoverSkill('random', False); GameTab(28); End;
End;
End;
Procedure FailSafe(Reason:String);
Begin
Players[CurrentPlayer].Loc:=Reason;
Logout;
Stats_Commit;
ProgressReport;
TerminateScript;
End;
{*******************************************************************************
Function CheckAndClick(X,Y:Integer):Boolean;
By: YoHoJo
Description: Moves mouse to x,y, checks for uptext, and clikcs if found
*******************************************************************************}
Function CheckAndClick(UpText:String; X,Y:Integer; Stronger:Boolean):Boolean;
Begin
MMouse(x, y, 5, 5);
If WaitUptext(UpText, 5000) Then
Begin
GetMousePos(x, y);
If Stronger Then
Begin
Mouse(X, Y, 0, 0, False);
Result:=WaitOption('tta', 3000)
End Else
Begin
Mouse(x, y, 0, 0,True);
Wait(100+Random(50));
FFlag(0);
End;
End;
End;
{*****************************************************************************
function YoHoIsFightAt(x, y: Integer): Boolean;
By: Frement (From SRL Moded by YoHoJo)
Description: Results True if a mainscreen HP bar is found near point X, Y.
See srl_InFight in Globals.scar for more info.
*****************************************************************************}
{function YoHoIsFightAt: Boolean;
var
HPBarCorner,HPBarRed, X, Y: Integer;
begin
HPBarCorner := DTMFromString('78DA6364646060606540051A108A11CA6504315888' +
'50C34C841A26026A988854C348400D33116A588850C34A841A36C26A0046A001D4');
HPBarRed := DTMFromString('mWAAAAHicY2FgYChiZmBYCcR9QNwDxGWMEFwExBVAbM3OhIJBwAgJM6JhEAAAZTsFyg==');
Result := FindDTM(HPBarCorner, X, Y, MSX1, MSY1, MSX2, MSY2) or
FindDTM(HPBarCorner, X, Y, MSX1, MSY1, MSX2, MSY2);
FreeDTM(HPBarCorner);
FreeDTM(HPBarRed);
end; }
Function YoHoIsFightAt: Boolean;
var
arP: TPointArray;
tmpCTS: Integer;
begin
Result:=False;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(5.33, 1.31);
FindColorsSpiralTolerance(MMCX, MMCY, arP, 78384, MSX1, MSY1, MSX2, MSY2, 3);
If Length(arP) > 30 Then
Begin
StatsGuise('We Are Fighting');
If IsChatBoxTextAnyLine('reach that', clBlack) Then
FailSafe('Out of Runes or Arrows');
Result:=True;
End;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
End;
Function DemonThere:Boolean;
var I:Integer;
ObjectInfoI: TIntegerArray;
ObjectInfoE: TExtendedArray;
ObjString: String;
GatePts:TPointArray;
GatePtsBox: T2DPointArray;
HighGate, Pixels:Integer;
Begin
ObjString:= '2 mo';
ObjectInfoE:=[0.26 , 1.30];
ObjectInfoI:=[1056332, 11];
Pixels:= 200;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(ObjectInfoE[0] , ObjectInfoE[1]);
FindColorsSpiralTolerance(MSCX,MSCY,GatePts,ObjectInfoI[0],MSX1,MSY1,MSX2,MSY2,ObjectInfoI[1]);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
GatePtsBox:= TPAtoATPAEx(GatePts,20,30);
//DebugATPA(GatePtsBox,'');
SortATPAFrom(GatePtsBox,Point(MSCX, MSCY));
HighGate:=High(GatePtsBox);
For I:=0 To HighGate Do
Begin
StatsGuise('Searching For Demon');
If Not(LoggedIn) Then Break;
If GetArrayLength(GatePtsBox[I])>Pixels Then
Begin
StatsGuise('Demon Found');
Result:=True;
Break;
End;
End;
End;
Procedure WaitForHP;
Var
FightSafe:Integer;
Begin
MarkTime(FightSafe);
While Not YoHoIsFightAt Do
Begin
Wait(50);
StatsGuise('We Are Fighting');
If TimeFromMark(FightSafe) > 10000 Then Break;
End;
End;
Function ClickObject(WhatObject:String):Boolean;
var I:Integer;
ObjectInfoI: TIntegerArray;
ObjectInfoE: TExtendedArray;
ObjString: String;
GatePts:TPointArray;
GatePtsBox: T2DPointArray;
GatePt: TPoint;
HighGate, Pixels:Integer;
Begin
Case WhatObject of
{ObjectInfoI[Color, Tolerance, BoxX, BoxY, Xmov, Ymov, SortX, SortY]}
'Demon':
Begin
ObjString:= '2 mo';
ObjectInfoE:=[0.26 , 1.30];
ObjectInfoI:=[1056332, 11];
Pixels:= 200;
End;
End;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(ObjectInfoE[0] , ObjectInfoE[1]);
FindColorsSpiralTolerance(MSCX,MSCY,GatePts,ObjectInfoI[0],MSX1,MSY1,MSX2,MSY2,ObjectInfoI[1]);
SetColorSpeed2Modifiers(0.2,0.2);
ColorToleranceSpeed(1);
GatePtsBox:= TPAtoATPAEx(GatePts,20,30);
//DebugATPA(GatePtsBox,'');
SortATPAFrom(GatePtsBox,Point(MSCX, MSCY));
HighGate:=High(GatePtsBox);
For I:=0 To HighGate Do
Begin
StatsGuise('Searching For Demon Try #: ' + IntToStr(I));
If Not(LoggedIn) Then Break;
If GetArrayLength(GatePtsBox[I])>Pixels Then
Begin
GatePt:= MiddleTPA(GatePtsBox[I]);
If CheckAndClick( ObjString, GatePt.x, GatePt.y, True) Then
Begin
{If DidRedClick Then
Begin}
StatsGuise('Attacked Demon');
Result:=True;
stats_IncVariable('Lesser Demons (Killed)', 1);
Inc(TAttacks);
MarkTime(LastAttack);
WaitForHP;
Break;
{End;}
End Else
Continue;
End;
End;
End;
Function SetupSpell:Boolean;
Begin
Begin
StatsGuise('Setting Autocast');
Writeln('Setting AutoCast');
If (LowerCase(Players[CurrentPlayer].Strings[0]) = 'range') Then
Begin
StatsGuise('You are ranging');
Result:=True;
End Else
Begin
StatsGuise('You are casting:' + Players[CurrentPlayer].Strings[0]);
Result:=True;
End;
If Not Result Then
Begin
FailSafe('Trouble Setting Up!');
End;
End;
End;
{*******************************************************************************
Procedure ProgressReport;
By: YoHoJo
Description: Overall progress/randoms reprot
*******************************************************************************}
procedure ProgressReport;
var Sec,AttackRate:integer;
begin
SRLRandomsReport;
Stats_Commit;
Sec:= (1+((Getsystemtime-StartTime)/1000));
AttackRate:=(3600*(TAttacks))/(Sec);
Writeln(' ');
Writeln ('/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\');
Writeln ('| --> YoHoJos LDSex '+ Version + ' <-- |');
Writeln ('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
Writeln('|' + PadR(' Worked for '+ (TimeRunning) , 49) + '|');
Writeln('|' + PadR(' Attacked '+IntToStr(TAttacks)+' Demons at a rate of '+IntToStr(AttackRate)+' per hour', 49) + '|');
Writeln('|' + PadR(' Location:' + Players[CurrentPlayer].Loc, 49) + '|');
Writeln ('\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/');
end;
begin
Smart_Server:=35;
TAttacks:=0;
if (SRLStats_Username = '') then
SetupSRLStats(243, 'Anonymous', 'anon1337')
else
SetupSRLStats(243, SRLStats_Username, SRLStats_Password);
SetUpSRL;
DeclarePlayers;
LogInPlayer;
StartTime:=GetSystemTime;
SetupSpell;
MarkTime(BreakCounter);
MarkTime(LastAttack);
ClickObject('Demon');
Repeat
If (TimeFromMark(LastAttack) > 600000) Then
FailSafe('10 Mintes and No Attack!?');
If (BreakEvery>0)
And
(TimeFromMark(BreakCounter) > (BreakEvery*60000)) Then
Begin
Case Random(1) Of
0: ExitToLobby;
1: Logout;
End;
SleepCounter:=0;
SleepTime:= ( (BreakFor*60000) + RandomRange(-120000, 120000));
While SleepCounter < SleepTime Do
Begin
Wait(5000);
SleepCounter:= (SleepCounter+5000);
StatsGuise('Breaking:'+IntToStr(((SleepTime)-SleepCounter)/1000)+'s Left');
End;
LoginPlayer;
Wait(3000+Random(1000));
MarkTime(BreakCounter);
MarkTime(LastAttack);
End;
If IsChatBoxTextAnyLine('reach that', clBlack) Then
FailSafe('Out of Runes or Arrows');
If TAttacks Mod 5 = 0 Then
ProgressReport;
While (Not(DemonThere)) Do
Begin
FindNormalRandoms;
If (TimeFromMark(LastAttack) > 600000) Then
FailSafe('10 Mintes and No Attack!?');
Wait(1000);
Antiban;
End;
FindNormalRandoms;
While YoHoIsFightAt Do
Begin
FindNormalRandoms;
If (TimeFromMark(LastAttack) > 600000) Then
FailSafe('10 Mintes and No Attack!?');
Wait(2000);
Antiban;
LevelUp;
End;
FindNormalRandoms;
ClickObject('Demon');
Until(False);
end.