Really want to start running the script; please post back when its updated.
Really want to start running the script; please post back when its updated.
I got it to compile but didn't bother testing. Hope this helps.
Simba Code:program W100S_EM;
{*******************************************************************************
W100S-EM - World 100 Shantay Chest Bonfires Er1k's Mod
author; CephaXz
modded; Er1k
Description: World 100 Shantay Chest Bonfire trainer
1.2 changelog
- Added SRL Stats
- Added more FindNormalRandoms for better random detection
- Minor additions to the object finders, showing colors count/ no detection
- Script turns assists to off for you, set chat to game at start
*******************************************************************************}
{$define SMART}
{$define USESPS}
//{$define USEODTM} //you must only enable either ODTM or SPS
{$i srl/srl.simba}
//
{$IFDEF SIMBAMAJOR980}
{$I SRL/SRL/Misc/PaintSmart.Simba}
{$ELSE}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}
//
{$IFDEF USEODTM}
{$i ObjectDTM\ObjDTMInclude.simba}
//{$ELSE}
//{$i srl/srl/misc/smartgraphics.simba}
{$ENDIF}
{$IFDEF USESPS}
{$i sps/sps.simba} //now used again
{$ENDIF}
const
ODTM_WALK = '81:91:4:9:7:39:60:9:7:30:81:9:7:91:95:9:7:99:74';
ODTM_AREA = '81:91:4:9:7:39:60:9:7:30:81:9:7:91:95:9:7:99:74:7:56:47:82:47:96:73:85:102:56:102:48:91:48:55';
var
Stats, Logs, CollectedRewards, StartingXP: Integer;
const
version = '1.2';
SRLStats_Username = '';
SRLStats_Password = '';
{Which slot in bank is your log is?}
LOGS_BANKSLOT = 1;
{How many ms to timeout for re-adding, change if you're LOW LEVEL}
FM_TIMEOUT = 10000;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
Players[0].WorldInfo := [False, 100]; //thanks olly
end;
procedure SetupLogin;
begin
ClearDebug;
{$IFDEF SMART}
{$IFDEF SIMBAMAJOR980}
Smart_Server := 72;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
{$ELSE}
SRL_SixHourFix := True;
Smart_FixSpeed := True;
{$ENDIF}
{$ENDIF}
SetupSRL;
if (SRLStats_Username = '') then
SetupSRLStats(1155, 'Anonymous', 'anon1337')
else
SetupSRLStats(1155, SRLStats_Username, SRLStats_Password);
DeclarePlayers;
if not LoggedIn then
begin
repeat
LoginPlayerToLob;
until LobbyScreen;
OpenWorldScreen;
if not WorldScreen then
OpenWorldScreen;
if WorldScreen then
begin
writeln('picking world 100');
SelectWorld(100);
LogInPlayer;
end;
end;
while not LoggedIn do
wait(500);
if LoggedIn then
begin
ClickNorth(SRL_ANGLE_HIGH);
ExitSquealOfFortune();
if not IsXPBarOpen then
ToggleXPBar(True);
StartingXP := GetXPBarTotal;
SetChat('off', CHAT_ASSIST); //turn off your assist so that you wont complain
SetChat('off', CHAT_PUBLIC);
Mouse(90 + (CHAT_GAME * 55), 496, 8, 3, mouse_left); //click game tab
end;
end;
Procedure StartDTM;
begin
Logs := DTMFromString('mwQAAAHic42RgYHBiYmCwZoLQ3kDsA8SBULYLVO4pUN0dIL4NxDeA+CEQPwPiN0D8Dog/ArGJngCQZMKL/zMQBoxEYDgAAI5rDB0=');
end;
Procedure EndDTM;
begin
FreeDTM(Logs);
end;
Function FindInvLogs: Boolean; //Modified by Er1k
var x, y: integer;
begin
Result := FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2);
end;
Function NotFindInvLogs: Boolean;
var x, y: integer;
begin
Result := not FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2);
end;
Function FoundInvLogs: Boolean;
var x, y: integer;
begin
if FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MouseItem(CoordsToItem(x, y), mouse_move);
Result := True;
end;
end;
function OpeningBank: boolean; //Modified by Er1k
begin
result:=false;
if not LoggedIn then Exit;
FindNormalRandoms;
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
if WaitFunc(@BankScreen, 100, 5000) then
begin
if not InvEmpty then DepositAll;
writeln('Withdrawing logs');
//Keep inventory slot
while GetBankItemAmount((LOGS_BANKSLOT-1) mod 10, (LOGS_BANKSLOT-1) div 10) = 0 do
begin
wait(100+random(50));
if not LoggedIn then Exit; //didn't expect this to fail actually, but it did
end;
writeln('amount of logs: ' + IntToStr(GetBankItemAmount((LOGS_BANKSLOT-1) mod 10, (LOGS_BANKSLOT-1) div 10)));
if GetBankItemAmount((LOGS_BANKSLOT-1) mod 10, (LOGS_BANKSLOT-1) div 10) < 29 then //sorry guys
begin
writeln('Not enough logs - Logout');
Logout;
TerminateScript;
end;
MouseBankSlot(LOGS_BANKSLOT, mouse_Right);
result:= WaitOption('All', 1000);
if result then
result:= CloseBank;
end;
end;
Function RewardsCollected :Boolean; //Unused
begin
Result := IsChatBoxTextAnyLine('spirit', clBlack);
end;
Function FindSpirit :Boolean; //Modified by Er1k
var
a: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
begin
result:=false;
if(not(LoggedIn))then Exit;
FindNormalRandoms;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
// Original colors
// SetColorSpeed2Modifiers(0.52, 0.55);
// if FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4021133, 202, 129, 325, 230, 14) then
SetColorSpeed2Modifiers(0.19, 0.75);
if FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3825566, 202, 129, 325, 230, 12) then
begin
writeln('color count: ' + InttoStr(length(tpa)));
if Length(TPA) < 20 then //modded
begin
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end else
begin
writeln('OMG SPIRIT?');
end;
end;
ATPA := TPAtoATPAEx(TPA, 20, 20);
SortATPAFromSize(ATPA, 1000, true);
for a := 0 to High(ATPA) do
begin
MP := MiddleTPA(ATPA[a]);
{$IFDEF SMART}
SMART_DrawDotsEx(false, ATPA[a], clYellow);
{$ENDIF}
Mouse(MP.X, MP.Y, 2, 2, mouse_move);
if WaitUpText('spiri', 500) then //using Uptext detection instead of just right-click
begin
ClickMouse2(mouse_right);
// Mouse(MP.X, MP.Y, 2, 2, mouse_Right);
if WaitOption('ollect', 3000) then
begin
WaitFunc(@RewardsCollected, 10, 3000);
writeln('Collect rewards');
writeln('Back to BonBon');
Result := True;
{$IFDEF SMART}
SMART_ClearCanvas;
{$ENDIF}
Break;
end;
end;
{$IFDEF SMART}
SMART_ClearCanvas;
{$ENDIF}
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
function BankScreenEx: boolean; //New
begin
result:= BankScreen or PinScreen;
end;
function FindShantayChest: boolean; //New
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
result:=false;
if not LoggedIn then Exit;
if BankScreenEx then
begin
result:=true;
Exit;
end;
FindNormalRandoms;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.12);
if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
begin
writeln('shantay chest tpa count: ' + IntToStr(length(tpa)));
ATPA:= TPAtoATPAEx(tpa, 25, 25);
for a:=0 to high(atpa) do
begin
{$IFDEF SMART}
SMART_DrawDotsEx(false, ATPA[a], clYellow);
{$ENDIF}
MP:= MiddleTPA(atpa[a]);
Mouse(mp.x, mp.y, 4, 4, mouse_move);
if WaitUpTextMulti(['pen S', 'antay','tay c', 'hest'], 500) then
begin
ClickMouse2(mouse_left);
if WaitFunc(@DidRedClick, 50, 1000) then
begin
writeln('Clicked Bank chest');
if WaitFunc(@BankScreenEx, 100, 5000) then
begin
writeln('BankScreenEx found');
result:= true;
{$IFDEF SMART}
SMART_ClearCanvas;
{$ENDIF}
break;
end;
end;
end;
end;
end
else writeln('Shantay chest not found...');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
procedure AntiBan;
var r: Integer;
begin
if not LoggedIn then Exit;
r := (RandomRange(1, 14));
if (r = 4) then
begin
writeln('Doing antiban');
case Random(20) of
0, 3: PickUpMouse;
1: RandomRClick;
2:
begin
HoverSkill('firemaking', false);
GameTab(tab_Inv);
end;
4: MMouse(MIX1, MIY1, MIX2, MIY2);
5: MMouse(MMX1, MMY1, MMX2, MMY2);
end;
end;
end;
function AddingScreen :Boolean;
begin
Result := CountColorTolerance(4543066, 17, 355, 484, 456, 2) > 2000;
end;
function BonBon: boolean; //Modified by Er1k
begin
result:=false;
if not LoggedIn then Exit;
if not (getCurrentTab = tab_Inv) then
FTab(tab_Inv);
if WaitFunc(@FoundInvLogs, 200, 5000) then
begin
ClickMouse2(mouse_Left);
if WaitFunc(@AddingScreen, 200, 5000) then
begin
writeln('Found add to bonfire screen');
MouseBox(323, 411, 389, 448, mouse_Left);
writeln('BONBONBONBON-ing');
result:= true;
end;
end;
end;
procedure XPTotalFinding;
var
XPGained: Integer;
begin
XPGained := GetXPBar(1);
writeln('EXP Gained' + IntToStr(XPGained));
end;
Procedure DrawTheBox;
var
XPBOX: TBox;
begin
XPBOX := IntToBox(375, 7, 421, 21);
SMART_DrawBox(XPBOX);
end;
procedure PlayerStats;
var
Wet, Wst, Cst, Srt, Tih, Tim, Tis, Awt, Sec, sst, EndingXP, XPGained: Integer;
begin
Cst := GetSystemTime;
Srt := (cst - sst) / 1000;
Tih := srt / 3600;
tim := (srt / 60) - tih * 60;
Tis := srt - tim * 60 - tih * 3600;
Awt := wet - wst
Sec := GetTimeRunning div 1000 + 1;
EndingXP := GetXPBarTotal;
XPGained := EndingXP - StartingXP;
Writeln('#######################################################');
Writeln(' Shantay Bank Chest Bonfire ');
Writeln('#######################################################');
Writeln('Logs / Hour : ' + IntToStr(Round(3600 * Players[CurrentPlayer].Integers[3] / Sec)));
Writeln('Logs Done : ' + IntToStr(Players[CurrentPlayer].Integers[3]));
Writeln('Fire Spirit : ' + IntToStr(CollectedRewards));
writeln('EXP Gained : ' + IntToStr(XPGained));
writeln('EXP / Hour : ' + IntToStr(Round(3600 * XPGained / Sec)));
Writeln('Running for : ' + TimeRunning);
Writeln('-------------------------------------------------------');
//SRL stats
if (TimeFromMark(Stats) > 360000) then // 6 minutes.
begin
Stats_Commit;
MarkTime(Stats);
end;
end;
function LogsDecreased(start: integer): boolean; //New
begin
result:= CountItems('dtm', logs, []) < start;
end;
function InShantayPassTPA: boolean;
var tpa: TPointArray;
begin
result:= false;
SetColorToleranceSpeed(1);
if FindMMColorsSpiralTolerance(tpa, 2248829, 25) then //rock brown
begin
writeln('tpa count: '+ IntToStr(length(tpa)));
result:= length(tpa) >= 850;
end;
writeln('InShantayPassTPA: ' + booltostr(result));
end;
function AdjustPositionTPA: boolean;
var x, y: integer;
tpa: TPointArray;
begin
result:= false;
if not InShantayPassTPA then Exit; //
SetColorToleranceSpeed(1);
if FindMMColorsSpiralTolerance(tpa, 2413294, 25) then //bank symbol
begin
writeln('tpa count: '+ IntToStr(length(tpa)));
MiddleTPAEx(tpa, x, y);
Mouse(x, y, 3, 3, mouse_left);
wait(1000+random(250));
while IsMoving do
wait(100+random(50));
result:= true;
end;
writeln('AdjustPositionTPA: ' + booltostr(result));
end;
//odtm main point
//'84:84:3:9:7:49:39:9:7:31:56:9:7:36:80'
//odtm area
//'80:80:3:9:7:49:39:9:7:31:56:9:7:36:80:8:58:40:77:40:92:53:92:83:76:96:61:96:51:81:51:46'
{$IFDEF USEODTM}
function InShantayPass: boolean; //New
begin
result:=false;
if not LoggedIn then Exit;
FindNormalRandoms;
result:= ObjDTM_InArea(ODTM_AREA, true);
end;
function AdjustPosition: boolean; //New
var odtm: string;
cx, cy: integer;
begin
result:=false;
if not LoggedIn then Exit;
FindNormalRandoms;
odtm:=ODTM_WALK;
if ObjDTM_Find(odtm, cx, cy, True) then
begin
result:= true;
Writeln('We found it, now lets walk it!');
ObjDTM_Walk(odtm, 2, 200, 10, True);
end else
Writeln('We could not walk here, what a shame');
if result then
FFlag(2);
end;
{$ENDIF}
{$IFDEF USESPS}
function InShantayPass: boolean;
var p: TPoint;
begin
result:= false;
FindNormalRandoms;
if not InShantayPassTPA then Exit;
p:= SPS_GetMyPos;
writeln('Acquiring position...');
writeln('SPS located: ' + format('%d %d', [p.x, p.y]));
if (p.x <= -1) and (p.y <= -1) then Exit; //lost
result:= (Distance(p.x, p.y, 5065, 4185) <= 75);
writeln('InShantayPass: ' + booltostr(result));
end;
function AdjustPosition: boolean; //New
var p: TPoint;
begin
result:= false;
FindNormalRandoms;
if not InShantayPass then
begin
writeln('Cannot adjust as we''re not in Shantay Pass');
writeln('AdjustPosition: ' + booltostr(result));
Exit;
end;
p:= SPS_GetMyPos();
writeln('Adjusting position...');
writeln('SPS located: ' + format('%d %d', [p.x, p.y]));
result:= SPS_WalkPath([Point(5060, 4185)]);
writeln('AdjustPosition: ' + booltostr(result));
end;
{$ENDIF}
function CheckWorld100: boolean;
var cw: integer;
begin
result:=false;
FindNormalRandoms;
cw:= CurrentWorld;
writeln('current world is: ' + IntToStr(cw));
if (cw<>100) then
begin
writeln('world switch required');
result:= ChangeWorld(100);
writeln('world switch success: ' + booltostr(result));
end
else result:= true;
end;
procedure MainLoop; //New
var action: string;
t, t2, t3, ts, start, fail, fail2, fail3: integer;
check, redo: boolean;
v: TVariantArray;
begin
action:= 'bank';
while LoggedIn do
begin
FindNormalRandoms;
writeln('Current action is: ' + action);
if fail > 0 then
writeln('fail: ' + IntToStr(fail));
if (fail >= 5) then
begin
writeln('banking failed consecutively...');
writeln('checking our position...');
FindNormalRandoms;
if InShantayPass then
action:='walk'
else
action:='lode';
end;
if (fail3 >= 3) then //verify if we''re in world 100
begin
writeln('failed to add to bonfires for quite a bit...');
writeln('verifying if we''re on world 100 at all...');
FindNormalRandoms;
if not CheckWorld100 then
begin
Logout; //finish the script and hope SMARTManager/CrashSMART restarts it
TerminateScript;
end
else fail3:= 0; //continue, we''re just having very bad luck
end;
case action of
'bank': begin
if FindShantayChest then
begin
if OpeningBank then
begin
WaitFunc(@FindInvLogs, 200, 2000);
action:= 'burn';
fail:= 0;
end;
end
else Inc(fail);
end;
'burn': begin
redo:= true;
check:=true;
if (CountItems('dtm', Logs, []) = 0) then
begin
action:='bank';
continue;
end;
if Bonbon then
begin
start:= CountItems('dtm', Logs, []);
writeln('starting logs: ' + IntToStr(start));
v:= [start];
//use first log adding as heuristic, does not work for low levels
//because low levels might have large delays in adding first log to bonfire
if not WaitFuncEx('LogsDecreased', v, 500, 5000) then
begin
writeln('Guessing no bonfires nearby, relocate!');
AdjustPosition;
Inc(fail2); //silent updated
//Maybe try to find fire here later??
//todo
//if you insist you want to make your own fires
//add code here, but i aint doing this for your safety
if (fail2 >= 2) then //force banking to relocate
begin
writeln('position adjusting doesnt seem to work...');
writeln('will try to find bank chest to relocate...');
action:='bank';
fail2:= 0;
Inc(fail3);
end;
continue;
end;
fail2:=0;
MarkTime(t);
MarkTime(t2);
MarkTIme(t3);
repeat
FindNormalRandoms;
// writeln('current logs: ' + IntToStr(CountItems('dtm', Logs, [])));
//find fire spirit, thanks Ashaman88 for the tips
if IsChatBoxTextAnyLine('emerges', 397249) and (InvCount<24) and check then
// if (FindChatBoxText('emerges',8,397249{clRed})) and (InvCount<24) then
begin
writeln('Spirit is around!');
if FindSpirit then
begin
check:= false; //dont scan after we have collected rewards
Inc(CollectedRewards);
break;
end;
end;
//update and continue
if LogsDecreased(start) then
begin
start:= CountItems('dtm', Logs, []);
MarkTime(t);
end;
//No update in FM_TIMEOUT ms, force redo
if (TimeFromMark(t) > FM_TIMEOUT) and not LogsDecreased(start) then
begin
writeln('Logs stopped burning - will reburn');
break;
end;
wait(250+random(250));
until (CountItems('dtm', Logs, []) = 0) or (TimeFromMark(t2) > 120000);
//Decide action
if (CountItems('dtm', Logs, []) = 0) then
begin
IncEx(Players[CurrentPlayer].Integers[3], 28);
redo:= false;
PlayerStats;
end;
if not redo then
action:= 'bank';
end;
end;
'walk': begin
if AdjustPosition then
begin
action:='bank';
fail:= 0;
end;
end;
'lode': begin
FindNormalRandoms;
writeln('If you get this chances are you''ve failed a random!');
writeln('Or you''ve got a random but SRL failed to detect it');
writeln('TODO - logout and terminate');
Logout;
TerminateScript;
end;
end;
wait(100+random(50));
end;
end;
procedure DebugLocations; //Acid test on location finders
begin
InShantayPass;
AdjustPosition;
end;
begin
SetupLogin;
{$IFDEF USEODTM}
ObjDTM_Setup; //req'd for ODTM usage
ObjDTM_Debug := True;
{$ENDIF}
{$IFDEF USESPS}
SPS_SETUP(RUNESCAPE_SURFACE,['12_10']);
{$ENDIF}
SMART_ClearCanvas;
AddOnTerminate('EndDTM');
StartDTM;
// UseFindMod := false; //uncomment if you don't want mods to mess up
// DebugLocations; //uncomment if you need debug
MainLoop;
end.
Yeah, the above script doesn't work.
It starts up, but gets stuck at Add to bonfire
(Doesn't want to click it, but instead shows :
Current action is: burn
Current action is: burn
Current action is: burn
Current action is: burn
Current action is: burn
Current action is: burn)
(Shantay pass)
Activity
Going asian on University College Ghent.
No time for anything atm.
[Error] C:\Simba\Includes\srl/srl/misc/smart.simba(56:19): Invalid number of parameters at line 55
Compiling failed.
Mine won't even get passed the login
Anyone able to update?
I think I speak for everyone when I say this would be absolutely brilliant to get up and working!
Sinking. Always. Sinking.
Working version of script here! I fixed it . Also tried adding support for anagoglic orts but i dont know if it works, i also dont know if simba reads the yellow text color in the chatbox.
Simba Code:program W100S_EM;
{*******************************************************************************
W100S-EM - World 100 Shantay Chest Bonfires Er1k's Mod
author; CephaXz
modded; Er1k
Description: World 100 Shantay Chest Bonfire trainer
1.2 changelog
- Added SRL Stats
- Added more FindNormalRandoms for better random detection
- Minor additions to the object finders, showing colors count/ no detection
- Script turns assists to off for you, set chat to game at start
*******************************************************************************}
{$define SMART}
{$define USESPS}
//{$define USEODTM} //you must only enable either ODTM or SPS
{$DEFINE SMART}
{$I SRL/SRL.Simba}
{$IFDEF USEODTM}
{.include ObjectDTM\ObjDTMInclude.simba}
{$ELSE}
{$I SRL/SRL/Misc/SmartGraphics.Simba}
{$ENDIF}
{$IFDEF USESPS}
{.include sps/sps.simba} //now used again
{$ENDIF}
const
ODTM_WALK = '81:91:4:9:7:39:60:9:7:30:81:9:7:91:95:9:7:99:74';
ODTM_AREA = '81:91:4:9:7:39:60:9:7:30:81:9:7:91:95:9:7:99:74:7:56:47:82:47:96:73:85:102:56:102:48:91:48:55';
var
Stats, Logs, CollectedRewards, StartingXP: Integer;
const
version = '1.2';
SRLStats_Username = '';
SRLStats_Password = '';
{Which slot in bank is your log is?}
LOGS_BANKSLOT = 5;
{How many ms to timeout for re-adding, change if you're LOW LEVEL}
FM_TIMEOUT = 10000;
procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Active := True;
Players[0].Pin := '';
Players[0].BoxRewards := ['Xp', 'mote', 'ostume', 'oins', 'aphire', 'ssence'];
// Players[0].WorldInfo := [False, 100]; //thanks olly
end;
procedure SetupLogin;
begin
ClearDebug;
SRL_SixHourFix := True;
Smart_FixSpeed := True;
SetupSRL;
if (SRLStats_Username = '') then
SetupSRLStats(1155, 'Anonymous', 'anon1337')
else
SetupSRLStats(1155, SRLStats_Username, SRLStats_Password);
DeclarePlayers;
if not LoggedIn then
begin
repeat
LoginPlayerToLob;
until LobbyScreen;
OpenWorldScreen;
if not WorldScreen then
OpenWorldScreen;
if WorldScreen then
begin
writeln('picking world 100');
SelectWorld(100);
LogInPlayer;
end;
end;
while not LoggedIn do
wait(500);
if LoggedIn then
begin
ClickNorth(SRL_ANGLE_HIGH);
ExitSquealOfFortune();
if not IsXPBarOpen then
ToggleXPBar(True);
StartingXP := GetXPBarTotal;
// SetChat('off', CHAT_ASSIST); //turn off your assist so that you wont complain
// SetChat('off', CHAT_PUBLIC);
Mouse(90 + (CHAT_GAME * 55), 496, 8, 3, mouse_left); //click game tab
end;
end;
Procedure StartDTM;
begin
Logs := DTMFromString('mwQAAAHic42RgYHBiYmCwZoLQ3kDsA8SBULYLVO4pUN0dIL4NxDeA+CEQPwPiN0D8Dog/ArGJngCQZMKL/zMQBoxEYDgAAI5rDB0=');
end;
Procedure EndDTM;
begin
FreeDTM(Logs);
end;
Function FindInvLogs: Boolean; //Modified by Er1k
var x, y: integer;
begin
Result := FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2);
end;
Function NotFindInvLogs: Boolean;
var x, y: integer;
begin
Result := not FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2);
end;
Function FoundInvLogs: Boolean;
var x, y: integer;
begin
if FindDTM(Logs, x, y, MIX1, MIY1, MIX2, MIY2) then
begin
MouseItem(CoordsToItem(x, y), mouse_move);
Result := True;
end;
end;
function OpeningBank: boolean; //Modified by Er1k
begin
result:=false;
if not LoggedIn then Exit;
FindNormalRandoms;
if PinScreen then
InPin(Players[CurrentPlayer].Pin);
if WaitFunc(@BankScreen, 100, 5000) then
begin
if not InvEmpty then DepositAll;
writeln('Withdrawing logs');
//Keep inventory slot
while GetBankItemAmount((LOGS_BANKSLOT-1) mod 10, (LOGS_BANKSLOT-1) div 10) = 0 do
begin
wait(100+random(50));
if not LoggedIn then Exit; //didn't expect this to fail actually, but it did
end;
writeln('amount of logs: ' + IntToStr(GetBankItemAmount((LOGS_BANKSLOT-1) mod 10, (LOGS_BANKSLOT-1) div 10)));
if GetBankItemAmount((LOGS_BANKSLOT-1) mod 10, (LOGS_BANKSLOT-1) div 10) < 29 then //sorry guys
begin
writeln('Not enough logs - Logout');
Logout;
TerminateScript;
end;
MouseBankSlot(LOGS_BANKSLOT, mouse_Right);
result:= WaitOption('All', 1000);
if result then
result:= CloseBank;
end;
end;
Function RewardsCollected :Boolean; //Unused
begin
Result := IsChatBoxTextAnyLine('spirit', clBlack);
end;
Function FindSpirit :Boolean; //Modified by Er1k
var
a: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
tmpCTS : Integer;
begin
result:=false;
if(not(LoggedIn))then Exit;
FindNormalRandoms;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
// Original colors
// SetColorSpeed2Modifiers(0.52, 0.55);
// if FindColorsSpiralTolerance(MSCX, MSCY, TPA, 4021133, 202, 129, 325, 230, 14) then
SetColorSpeed2Modifiers(0.19, 0.75);
if FindColorsSpiralTolerance(MSCX, MSCY, TPA, 3825566, 202, 129, 325, 230, 12) then
begin
writeln('color count: ' + InttoStr(length(tpa)));
if Length(TPA) < 20 then //modded
begin
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
Exit;
end else
begin
writeln('OMG SPIRIT?');
end;
end;
ATPA := TPAtoATPAEx(TPA, 20, 20);
SortATPAFromSize(ATPA, 1000, true);
for a := 0 to High(ATPA) do
begin
MP := MiddleTPA(ATPA[a]);
{$IFDEF SMART}
SMART_DrawDotsEx(false, ATPA[a], clYellow);
{$ENDIF}
Mouse(MP.X, MP.Y, 2, 2, mouse_move);
if WaitUpText('spiri', 500) then //using Uptext detection instead of just right-click
begin
ClickMouse2(mouse_right);
// Mouse(MP.X, MP.Y, 2, 2, mouse_Right);
if WaitOption('ollect', 3000) then
begin
WaitFunc(@RewardsCollected, 10, 3000);
writeln('Collect rewards');
writeln('Back to BonBon');
Result := True;
{$IFDEF SMART}
SMART_ClearCanvas;
{$ENDIF}
Break;
end;
end;
{$IFDEF SMART}
SMART_ClearCanvas;
{$ENDIF}
end;
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
function BankScreenEx: boolean; //New
begin
result:= BankScreen or PinScreen;
end;
function FindShantayChest: boolean; //New
var a, tmpCTS, Tries: Integer;
TPA : TPointArray;
ATPA : T2DPointArray;
MP : TPoint;
begin
result:=false;
if not LoggedIn then Exit;
if BankScreenEx then
begin
result:=true;
Exit;
end;
FindNormalRandoms;
tmpCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
SetColorSpeed2Modifiers(0.07, 0.12);
if FindColorsSpiralTolerance(MSCX, MSCY, tpa, 6451582, MSX1, MSY1, MSX2, MSY2, 7) then
begin
writeln('shantay chest tpa count: ' + IntToStr(length(tpa)));
ATPA:= TPAtoATPAEx(tpa, 25, 25);
for a:=0 to high(atpa) do
begin
{$IFDEF SMART}
SMART_DrawDotsEx(false, ATPA[a], clYellow);
{$ENDIF}
MP:= MiddleTPA(atpa[a]);
Mouse(mp.x, mp.y, 4, 4, mouse_move);
if WaitUpTextMulti(['pen S', 'antay','tay c', 'hest'], 500) then
begin
ClickMouse2(mouse_left);
if WaitFunc(@DidRedClick, 50, 1000) then
begin
writeln('Clicked Bank chest');
if WaitFunc(@BankScreenEx, 100, 5000) then
begin
writeln('BankScreenEx found');
result:= true;
{$IFDEF SMART}
SMART_ClearCanvas;
{$ENDIF}
break;
end;
end;
end;
end;
end
else writeln('Shantay chest not found...');
ColorToleranceSpeed(tmpCTS);
SetColorSpeed2Modifiers(0.2, 0.2);
end;
procedure AntiBan;
var r: Integer;
begin
if not LoggedIn then Exit;
r := (RandomRange(1, 14));
if (r = 4) then
begin
writeln('Doing antiban');
if inchat('anagogic') then
begin
MMouse(261, 227, 6, 6);
if IsUptext('gog') then
ClickMouse2(true);
end;
case Random(20) of
0, 3: PickUpMouse;
1: RandomRClick;
2:
begin
HoverSkill('firemaking', false);
GameTab(tab_Inv);
end;
4: MMouse(MIX1, MIY1, MIX2, MIY2);
5: MMouse(MMX1, MMY1, MMX2, MMY2);
end;
end;
end;
function AddingScreen :Boolean;
begin
Result := CountColorTolerance(4141067, 17, 355, 484, 456, 2) > 2000;
end;
function BonBon: boolean; //Modified by Er1k
begin
result:=false;
if not LoggedIn then Exit;
if not (getCurrentTab = tab_Inv) then
FTab(tab_Inv);
if WaitFunc(@FoundInvLogs, 200, 5000) then
begin
ClickMouse2(mouse_Left);
if WaitFunc(@AddingScreen, 200, 5000) then
begin
writeln('Found add to bonfire screen');
MouseBox(323, 411, 389, 448, mouse_Left);
writeln('BONBONBONBON-ing');
result:= true;
end;
end;
end;
procedure XPTotalFinding;
var
XPGained: Integer;
begin
XPGained := GetXPBar(1);
writeln('EXP Gained' + IntToStr(XPGained));
end;
Procedure test;
var
bb: TBox;
begin
bb := IntToBox(323, 411, 389, 448);
SMART_DrawBox(bb);
end;
Procedure DrawTheBox;
var
XPBOX: TBox;
begin
XPBOX := IntToBox(375, 7, 421, 21);
SMART_DrawBox(XPBOX);
end;
procedure PlayerStats;
var
Wet, Wst, Cst, Srt, Tih, Tim, Tis, Awt, Sec, sst, EndingXP, XPGained: Integer;
begin
Cst := GetSystemTime;
Srt := (cst - sst) / 1000;
Tih := srt / 3600;
tim := (srt / 60) - tih * 60;
Tis := srt - tim * 60 - tih * 3600;
Awt := wet - wst
Sec := GetTimeRunning div 1000 + 1;
EndingXP := GetXPBarTotal;
XPGained := EndingXP - StartingXP;
Writeln('#######################################################');
Writeln(' Shantay Bank Chest Bonfire ');
Writeln('#######################################################');
Writeln('Logs / Hour : ' + IntToStr(Round(3600 * Players[CurrentPlayer].Integers[3] / Sec)));
Writeln('Logs Done : ' + IntToStr(Players[CurrentPlayer].Integers[3]));
Writeln('Fire Spirit : ' + IntToStr(CollectedRewards));
writeln('EXP Gained : ' + IntToStr(XPGained));
writeln('EXP / Hour : ' + IntToStr(Round(3600 * XPGained / Sec)));
Writeln('Running for : ' + TimeRunning);
Writeln('-------------------------------------------------------');
//SRL stats
if (TimeFromMark(Stats) > 360000) then // 6 minutes.
begin
Stats_Commit;
MarkTime(Stats);
end;
end;
function LogsDecreased(start: integer): boolean; //New
begin
result:= CountItems('dtm', logs, []) < start;
end;
function InShantayPassTPA: boolean;
var tpa: TPointArray;
begin
result:= false;
SetColorToleranceSpeed(1);
if FindMMColorsSpiralTolerance(tpa, 2248829, 25) then //rock brown
begin
writeln('tpa count: '+ IntToStr(length(tpa)));
result:= length(tpa) >= 850;
end;
writeln('InShantayPassTPA: ' + booltostr(result));
end;
function AdjustPositionTPA: boolean;
var x, y: integer;
tpa: TPointArray;
begin
result:= false;
if not InShantayPassTPA then Exit; //
SetColorToleranceSpeed(1);
if FindMMColorsSpiralTolerance(tpa, 2413294, 25) then //bank symbol
begin
writeln('tpa count: '+ IntToStr(length(tpa)));
MiddleTPAEx(tpa, x, y);
Mouse(x, y, 3, 3, mouse_left);
wait(1000+random(250));
while IsMoving do
wait(100+random(50));
result:= true;
end;
writeln('AdjustPositionTPA: ' + booltostr(result));
end;
//odtm main point
//'84:84:3:9:7:49:39:9:7:31:56:9:7:36:80'
//odtm area
//'80:80:3:9:7:49:39:9:7:31:56:9:7:36:80:8:58:40:77:40:92:53:92:83:76:96:61:96:51:81:51:46'
{$IFDEF USEODTM}
function InShantayPass: boolean; //New
begin
result:=false;
if not LoggedIn then Exit;
FindNormalRandoms;
result:= ObjDTM_InArea(ODTM_AREA, true);
end;
function AdjustPosition: boolean; //New
var odtm: string;
cx, cy: integer;
begin
result:=false;
if not LoggedIn then Exit;
FindNormalRandoms;
odtm:=ODTM_WALK;
if ObjDTM_Find(odtm, cx, cy, True) then
begin
result:= true;
Writeln('We found it, now lets walk it!');
ObjDTM_Walk(odtm, 2, 200, 10, True);
end else
Writeln('We could not walk here, what a shame');
if result then
FFlag(2);
end;
{$ENDIF}
{$IFDEF USESPS}
function InShantayPass: boolean;
var p: TPoint;
begin
result:= false;
FindNormalRandoms;
if not InShantayPassTPA then Exit;
p:= SPS_GetMyPos;
writeln('Acquiring position...');
writeln('SPS located: ' + format('%d %d', [p.x, p.y]));
if (p.x <= -1) and (p.y <= -1) then Exit; //lost
result:= (Distance(p.x, p.y, 5065, 4185) <= 75);
writeln('InShantayPass: ' + booltostr(result));
end;
function AdjustPosition: boolean; //New
var p: TPoint;
begin
result:= false;
FindNormalRandoms;
if not InShantayPass then
begin
writeln('Cannot adjust as we''re not in Shantay Pass');
writeln('AdjustPosition: ' + booltostr(result));
Exit;
end;
p:= SPS_GetMyPos();
writeln('Adjusting position...');
writeln('SPS located: ' + format('%d %d', [p.x, p.y]));
result:= SPS_WalkPath([Point(5060, 4185)]);
writeln('AdjustPosition: ' + booltostr(result));
end;
{$ENDIF}
function CheckWorld100: boolean;
var cw: integer;
begin
result:=false;
FindNormalRandoms;
cw:= CurrentWorld;
writeln('current world is: ' + IntToStr(cw));
if (cw<>100) then
begin
writeln('world switch required');
result:= ChangeWorld(100);
writeln('world switch success: ' + booltostr(result));
end
else result:= true;
end;
procedure MainLoop; //New
var action: string;
t, t2, t3, ts, start, fail, fail2, fail3: integer;
check, redo: boolean;
v: TVariantArray;
begin
action:= 'bank';
while LoggedIn do
begin
FindNormalRandoms;
writeln('Current action is: ' + action);
if fail > 0 then
writeln('fail: ' + IntToStr(fail));
if (fail >= 5) then
begin
writeln('banking failed consecutively...');
writeln('checking our position...');
FindNormalRandoms;
if InShantayPass then
action:='walk'
else
action:='lode';
end;
if (fail3 >= 3) then //verify if we''re in world 100
begin
writeln('failed to add to bonfires for quite a bit...');
writeln('verifying if we''re on world 100 at all...');
FindNormalRandoms;
if not CheckWorld100 then
begin
Logout; //finish the script and hope SMARTManager/CrashSMART restarts it
TerminateScript;
end
else fail3:= 0; //continue, we''re just having very bad luck
end;
case action of
'bank': begin
if FindShantayChest then
begin
if OpeningBank then
begin
WaitFunc(@FindInvLogs, 200, 2000);
action:= 'burn';
fail:= 0;
end;
end
else Inc(fail);
end;
'burn': begin
redo:= true;
check:=true;
if (CountItems('dtm', Logs, []) = 0) then
begin
action:='bank';
continue;
end;
if Bonbon then
begin
start:= CountItems('dtm', Logs, []);
writeln('starting logs: ' + IntToStr(start));
v:= [start];
//use first log adding as heuristic, does not work for low levels
//because low levels might have large delays in adding first log to bonfire
if not WaitFuncEx('LogsDecreased', v, 500, 5000) then
begin
writeln('Guessing no bonfires nearby, relocate!');
AdjustPosition;
Inc(fail2); //silent updated
//Maybe try to find fire here later??
//todo
//if you insist you want to make your own fires
//add code here, but i aint doing this for your safety
if (fail2 >= 2) then //force banking to relocate
begin
writeln('position adjusting doesnt seem to work...');
writeln('will try to find bank chest to relocate...');
action:='bank';
fail2:= 0;
Inc(fail3);
end;
continue;
end;
fail2:=0;
MarkTime(t);
MarkTime(t2);
MarkTIme(t3);
repeat
FindNormalRandoms;
// writeln('current logs: ' + IntToStr(CountItems('dtm', Logs, [])));
//find fire spirit, thanks Ashaman88 for the tips
if IsChatBoxTextAnyLine('emerges', 397249) and (InvCount<24) and check then
// if (FindChatBoxText('emerges',8,397249{clRed})) and (InvCount<24) then
begin
writeln('Spirit is around!');
if FindSpirit then
begin
check:= false; //dont scan after we have collected rewards
Inc(CollectedRewards);
break;
end;
end;
//update and continue
if LogsDecreased(start) then
begin
start:= CountItems('dtm', Logs, []);
MarkTime(t);
end;
//No update in FM_TIMEOUT ms, force redo
if (TimeFromMark(t) > FM_TIMEOUT) and not LogsDecreased(start) then
begin
writeln('Logs stopped burning - will reburn');
break;
end;
wait(250+random(250));
until (CountItems('dtm', Logs, []) = 0) or (TimeFromMark(t2) > 120000);
//Decide action
if (CountItems('dtm', Logs, []) = 0) then
begin
IncEx(Players[CurrentPlayer].Integers[3], 28);
redo:= false;
PlayerStats;
end;
if not redo then
action:= 'bank';
end;
end;
'walk': begin
if AdjustPosition then
begin
action:='bank';
fail:= 0;
end;
end;
'lode': begin
FindNormalRandoms;
writeln('If you get this chances are you''ve failed a random!');
writeln('Or you''ve got a random but SRL failed to detect it');
writeln('TODO - logout and terminate');
Logout;
TerminateScript;
end;
end;
wait(100+random(50));
end;
end;
procedure DebugLocations; //Acid test on location finders
begin
InShantayPass;
AdjustPosition;
end;
begin
SetupLogin;
{$IFDEF USEODTM}
ObjDTM_Setup; //req'd for ODTM usage
ObjDTM_Debug := True;
{$ENDIF}
{$IFDEF USESPS}
SPS_SETUP(RUNESCAPE_SURFACE,['12_10']);
{$ENDIF}
SMART_ClearCanvas;
AddOnTerminate('EndDTM');
StartDTM;
// UseFindMod := false; //uncomment if you don't want mods to mess up
// DebugLocations; //uncomment if you need debug
// OpeningBank;
MainLoop;
end.
Last edited by mika; 08-15-2012 at 11:26 PM.
^ Looks more in place now![]()
Activity
Going asian on University College Ghent.
No time for anything atm.
Nice script! Works great! Thanks man
You forgot something on the script.
Im sure it checks for that red text on game box for tracking fire spirits right?
But as long as the red line is still visible it keeps looking for the spirit even if it was already freed.
You should add something to ignore that specific red line after the spirit is freed.
Randoms are still a problem. cant do any randoms. logs out after every random appears and sometimes tries doing it and fails and then my player is teleported to some random place and script logs out.
Apart from that the script is awesome
Last edited by [F]aceless; 08-18-2012 at 05:28 PM.
Good fix, Mika. Working like a charm:
Progress Report:####################################################### Shantay Bank Chest Bonfire ####################################################### Logs / Hour : 733 Logs Done : 224 Fire Spirit : 24 EXP Gained : 63574 EXP / Hour : 208060 Running for : 18 Minutes and 19 Seconds -------------------------------------------------------
Works like a charm, just hate that randoms are quite frequent... :/Simba Code:#######################################################
Shantay Bank Chest Bonfire
#######################################################
Logs / Hour : 875
Logs Done : 1036
Fire Spirit : 12
EXP Gained : 152543
EXP / Hour : 128849
Running for : 1 Hours, 11 Minutes and 1 Seconds
-------------------------------------------------------
Especially at xp rates like this.
I always expect a random after about 100-125k xp.
Mostly that is a right estimate.
Activity
Going asian on University College Ghent.
No time for anything atm.
Last time I used this I must of got closed to getting banned, people sometimes start a bunch of random fires away from the chest and all the people that move away from the chest and go to those random fires on their own are obviously bots.
Does this still happen with the script, or does it force you to stay on a fire that is one square beside the bank chest?
shantay chest tpa count: 213
Clicked Bank chest
BankScreenEx found
Withdrawing logs
doesnt withdraw ,just sits there
Hope This Gets Updated Soon =)
Last edited by bweibking; 08-24-2012 at 05:15 AM.
the randoms are always breaking the script because it cant do randoms.
You REALLLLLY have to babysit this much more than other bots. If someone makes a fire a couple squares away from the chest, this will use it, and then say they make a fire another square or two over it will use that. But then if that fire goes out, it kind of gets stuck since it can't add logs to fire - no fire in range. And it is dead obvious who the bots are. People are already suspicious when people run out and use the other random fires rather than the one by the chest.
If the script used its old method of finding a fire and then doing click log --> use --> click fire, then it shhouldn't be too hard to write a bit of code to search for fires, provide arbitary distance values from the chest and then decide to use whichever one is closest to the chest.
Of course none of this is going to happen since this script (along with part of the community) seems dead. But thats' just my 2 cents.
Been here an hour and already some guy is lighting fires all the way over at the side shouting "bot trap lololol"
![]()
Got 99!!
Thanks Erik! Thanks Mika!
U can add me to the OP
Congratulations!
(another "bot trap")
Holy shit these people in W100 Shantary are doing my head in, considering buying Magic logs just to get through this faster. I don't think I am going to make it through this without a ban/statwipe. The people here are actively seeking out bots and are so suspicious.
With that said, even if I were to be reported I am not sure it would even result in any trouble, I have been talking in game quite a bit today anyway
Any chance of getting any anti-randoms?
The script is flawless, it's amazing!
But the randoms are unbearable!
There's no way to avoid randoms. So, anti-randoms don't exist.
All you have to do is complete the random.
If it fails the random, the script writer has nothing to do with it, since randoms solvers are implemented on Simba.
If you see that the script fails some random, you should post in the right section of this forum, in order that developers update the random's solver.
''If you want something you've never had, you have to do something you've never done''
total leve 2715/1b exp +... exterminated.
[Error] C:\Simba\Includes\srl/srl/misc/smart.simba(46:19): Invalid number of parameters at line 45
Compiling failed.
any help?
☆Haterz Make Me Famouz☆
There are currently 1 users browsing this thread. (0 members and 1 guests)