SRL Archive - First Scripts

G_Alch - Alchs anything!


giavanni6

2015-02-21 21:34:39

Features:
Playerform

To Do List:
Antiban
Make a constant for alch slots
Change cast recognition
Figure out why it HAS to spawn it's own client. Something's screwed with the player form.

Directions:
1: Do not start the script on a new SMART Client, for some reason it doesn't want to work when it doesn't spawn it's own. IDK why.
2: Make sure you have Nature Runes in your inventory(Script will stop when out)
3: Put your alchable item in it's appropriate slot(See setup)
4: Put High Alch on actionbar slot #1

Script Version: 1.3

      
program G_Alcher;
{$DEFINE SMART}
{$I SRL-6/SRL.simba}

(* Setup you information below!*)

const
(* player info *)
playerNames = [''];
playerFile = 'default';
desiredWorld = 100; //World to login to
itemSlot = 2; //The backpack slot the item you're alching is located.


(* END SETUP, DO NOT CHANGE BELOW UNLESS YOU KNOW WHAT YOU'RE DOING*)



var
i, timesAlched, timesTried:integer;


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;
exitTreasure();
exit;
end;
end;
end;

procedure alch();
begin
if (actionBar.isSlotActive(1)) then
begin
wait(10 + randomRange(+100,200));
tabBackpack.mouseSlot(itemSlot, MOUSE_LEFT);
inc(timesAlched);
wait(2000 + randomRange(-500, 900));
end else typeSend('1', false)
end;

begin
clearDebug;
writeLn('********************************************');
writeLn('* G_alch V_1.3 (Thank you KeepBotting! *');
writeLn('********************************************');
writeLn('We have alched ' + intToStr(timesAlched) + ' times. ');
begin
writeLn('We have gained ' + intToStr(timesAlched*65) + ' xp.');
end
writeLn('We have been working for ' + timeRunning + '');
writeLn('********************************************');
end;





// main loop
begin

initScript;

repeat
alch;
until not tabBackpack.isItemInSlot(itemSlot) or chatbox.findText(['unes to cast this spe']);
end.



This is a quick script that I through together from bits and pieces of KeepBotting's I_Alch.

Alching is very simple, but if you want more features please post below and I'll work on it.

Credits:
TheMayor - For his tutorials
KeepBotting - For his I_alch script, which most of this code is from, just slightly edited. (I hope you don't mind, your script is fairly outdated)

J_R

2015-02-22 07:47:46

Well if you do
 smartForceNewClient := true 
I suppose you shouldn't be too surprised if it forces you to start a new SMART client every time you start the script :P

If you get rid of that line, it should probably get rid of that little bug.