Simba Code:
program iDuelist_SLAVE;
{$DEFINE SMART}
{$i srl-6/srl.simba}
///////////////////////////////////Start setting up the script here. Refer to the comments if you don't know what you're doing.
///////////////////////////////////
///// Start Setup ///////
///////////////////////////////////
///////////////////////////////////Start setting up the script here. Refer to the comments if you don't know what you're doing.
const
(* player info *)
playerNames = ['slave']; //Put the slave's player name (or nickname, if you set one) here.
playerFile = 'default1'; //Put your playerfile's name here. Default is 'default'.
desiredWorld = 0; //MAKE SURE MASTER & SLAVE ARE ON THE SAME WORLD LOL
(* globals *)
//Please fill out the globals on the MASTER script. The slave has no globals!
(* options *)
//Please fill out the options on the MASTER script. The slave has no options!
///////////////////////////////////Don't modify the script ANY FURTHER unless you know what you're doing. You could break stuff!
///////////////////////////////////
///// Stop Setup ///////
///////////////////////////////////
///////////////////////////////////Don't modify the script ANY FURTHER unless you know what you're doing. You could break stuff!
procedure getInfo;
begin;
writeLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
writeLn('Welcome to iDuelist.SLAVE by KeepBotting!');
writeLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
writeLn('This script is 100% credits to KeepBotting, unless otherwise noted.');
writeLn('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
end;
function challengeTypeScreen: boolean; //friendly or staked?
var x, y:integer;
begin
result := FindColor(x, y, 1489692, 433, 425, 524, 438);
//the text and its background on the 'send challenge' button
end;
function duelScreen: boolean; //duel interface where options are selected
var x, y:integer;
begin
result := FindColor(x, y, 12378347, 406, 159, 552, 176);
//opponent's username at top of interface
end;
function duelScreen_2: boolean; //duel interface where options are reviewed before duel starts
var x, y:integer;
begin
result := FindColor(x, y, 5353701, 424, 280, 531, 292);
//'During the duel...' text on the 2nd section of the interface
end;
function resultsScreen: boolean; //you won/lost screen
var x, y:integer;
begin
result := FindColor(x, y, 6533359, 387, 434, 572, 451);
//the text on the 'offer rematch' button (not background as it grabs half the interface)
//no need to worry about relocating players as Jagex has kindly provided an auto-rematch button for us <3
end;
function isChallengePending: boolean;
var x, y:integer;
begin
result := FindColor(x, y, 12926, 8, 535, 553, 611);
//color of challenge text in chatbox
end;
function getSlaveStatus: string;
begin
//ini file-operations will go here
end;
procedure initScript; //adapted from bonsai's init procedure
var i:integer;
begin
addOnTerminate('scriptTerminate');
clearDebug();
smartEnableDrawing := true;
setupSrl();
smartForceNewClient := true; //thanks olly
players.setup(playerNames, playerFile);
currentPlayer := 0;
for i := 0 to high(players) do
begin
players[i].world := desiredWorld;
players[i].isActive := true;
end;
while (players.getActive() > 0) do
begin
if (not isLoggedIn()) then
begin
if (not players[currentPlayer].login()) then break;
exitSquealOfFortune();
end;
end;
end;
procedure waitForMaster;
var value:string;
begin
clearDebug();
writeLn('[MultiScriptHandler] : The slave script is ready.');
writeLn('[MultiScriptHandler] : Please start the master script.');
writeLn('[MultiScriptHandler] : The process will begin automatically once the master is logged in.');
repeat
writeLn('[MultiScriptHandler] : Please start the master script; waiting for communication...');
wait(1000);
until ReadINI('MASTER', 'MasterStatus', AppPath +'\MasterINI.ini');
writeLn('[MultiScriptHandler] : Communiction established. Process beginning.');
end;
procedure test;
begin
writeln(ScriptPath);
writeln(getfiles(ScriptPath, 'ini'));
end;
begin
//waitForMaster;
test;
end.