SRL Archive - Archive

The Killer - SRL Member Application


The Killer

2012-12-31 13:16:35

How Long have You Played Runescape?
6 Year(s)


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?
Yes, Google referred me here when I googled "Simba runescape" ;) (no the user google :P)


What is your general programming knowledge?
Just Pascal, Want to learn java soon and start to expand my knowledge. After all, knowledge is power ;)


Are you a member of any other communities?
No


Tell us about yourself…
From: The Killer
Well, I'm Steven (As fellow skypes know), I'm 14, and live in the UK. I enjoy playing football. I'v been at villavu for about 10 months now and have got to learn a basic to intermediate knowledge of pascal. During my time here I'v also made friends etc.

Please, when voting can you explain why. I still have bits to learn and want to continue my learning so by posting I know what I'n doing right and what I'm doing wrong :P

note: not all my scripting abiltys are in the script due to the nature of it.
e.g. No Dtms and Walking.



Please show us one (or multiple) of your scripts.
Program KillersHeater;
{$DEFINE SMART}
{$I SRL/SRL.simba}
{==============================================================================}
{========== INSTRUCTIONS ==========}
{==============================================================================}
{========== Killer's Superheater v1.18 ==========}
{==============================================================================}
{========== 1. Fill out all the information below. =========}
{========== 2. Put Primary ore in 9th bank slot. =========}
{========== 3. Put the coal in the 10th bank slot. =========}
{========== 4. Enjoy the Script =========}
{========== 5. Post proggies and bugs please. =========}
{==============================================================================}
{==============================================================================}
const
BarsToDo = 5000;
Bank = 'veb'; // change to w/e you want from bank.simba (only required if not using bankchest)
BankChest = SRL_BANK_SW; // change to w/e you want from bank.simba (only required if using bankchest)
Chest = False; //Set to true if the bank your using is a chest
SpeedOfMouse = 20; //increase to speed up, decrease to slow down.
Debug = False; // Debugs, use if having problems. Havn't really put into full use yet
Bar = ''; //Valid Arguments: iron, silver, steel, gold, mithril, addy, rune
CoalBag = True; // true if using coalbag
Goldgauntlets = False; // true if using gauntlets while smelting gold (only needed for xp calc)
CoalColour = 1844517; // No need to touch this
TimeToWait = 250; //Time to wait in waitchooseoption
{==============================================================================}
{==============================================================================}
Procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
with Players[0] do
begin
Name := ''; //login in name
Pass := ''; //Password
Pin := ''; // Leave blank if you don't have one
Active := True;
end;
end;
{==============================================================================}
{========== End of Setup ==========}
{==============================================================================}

type TOreInfo = record
UsesCoal: Boolean;
BarsPerInv, OreColour, SlotToClick: Integer;
Name: String;
SmithXpBar: Extended;
BoxCheck: TBox;
end;

var
loadsDone, loadtime, Heats, Tries: Integer;
BarInfo: TOreInfo;

Function CoalCheck(WithCoalBag, WithoutCoalBag: Integer): Integer;
begin
if Coalbag then
Result := WithCoalBag
else
Result := WithoutCoalBag;
end;

function GaulentsCheck: Extended;
begin
if Goldgauntlets then
Result := 56.2
else
Result := 22.5;
end;

function SlotToClick: Integer;
begin
if Coalbag then
Result := barinfo.BarsPerInv + 2
else
Result := barinfo.BarsPerInv +1;
end;

procedure LoadBarInfo;
begin
case lowercase (Bar) of
'silver': begin
barinfo.UsesCoal := False;
barinfo.BarsPerInv := 27;
barinfo.SmithXpBar := 13.7;
barinfo.OreColour := 9472650;
barinfo.SlotToClick:= SlotToClick;
barinfo.Name := 'Silver';
end;

'iron': begin
barinfo.UsesCoal := False;
barinfo.BarsPerInv := 27;
barinfo.SmithXpBar := 12.5;
barinfo.OreColour := 1647162;
barinfo.SlotToClick:= SlotToClick;
barinfo.Name := 'Iron';
end;

'steel': begin
barinfo.UsesCoal := True
barinfo.BarsPerInv := CoalCheck(17, 8);
barinfo.SmithXpBar := 17.5;
barinfo.OreColour := 1647162;
barinfo.SlotToClick:= SlotToClick;
barinfo.Name := 'Steel';
end;

'gold': begin
barinfo.UsesCoal := False;
barinfo.BarsPerInv := 26;
barinfo.SmithXpBar := GaulentsCheck;
barinfo.OreColour := 1741753;
barinfo.SlotToClick:= SlotToClick;
barinfo.Name := 'Gold';
end;

'mithril': begin
barinfo.UsesCoal := True
barinfo.BarsPerInv := CoalCheck(10, 5);
barinfo.SmithXpBar := 30;
barinfo.OreColour := 5388087;
barinfo.SlotToClick:= SlotToClick;
barinfo.Name := 'Mithril';
end;

'addy': begin
barinfo.UsesCoal := True;
barinfo.BarsPerInv := CoalCheck(7, 3);
barinfo.SmithXpBar := 37.5;
barinfo.OreColour := 4015933;
barinfo.SlotToClick:= SlotToClick;
barinfo.Name := 'Addy';
end;

'rune': begin
barinfo.UsesCoal := True
barinfo.BarsPerInv := CoalCheck(7, 3);
barinfo.SmithXpBar := 50;
barinfo.OreColour := 5722179;
barinfo.SlotToClick:= SlotToClick;
barinfo.Name := 'Rune';
end;
end;
end;

Procedure ResetBank;
begin
if not LoggedIn then LoginPlayer;
FindNormalRandoms;
if Chest then
OpenBankChestEdge(bankchest)
else
OpenBankFast(bank);

if not Bankscreen or Pinscreen then
begin
Tries := 0;
Repeat
if Chest then
OpenBankChestEdge(bankchest)
else
OpenBankFast(bank);
InPin(Players[0].Pin);
Inc(Tries);
Until (Tries > 3) or Bankscreen;
end;

if not Pinscreen then
begin
Tries := 0;
Repeat
InPin(Players[0].Pin);
Inc(Tries);
Until (Tries > 3) or Bankscreen;
end;

if Tries > 3 then
begin
Writeln('Entering pin or opening bank has failed');
writeln('logging off...');
Logout;
writeln('Terminating script...');
TerminateScript;
end;

FixBank;
if CoalBag then
begin
Deposit(3, 25, True);
Mouse(621, 232, 5, 5, mouse_right);
if not WaitOption('mpty', TimeToWait) then
Writeln('Failed to empty coalbag');
wait(1000);
Deposit(3, 28, True);
end else
Deposit(2, 25, True);
end;

Function FailedBank: Boolean;
var
x, y: integer;
ibox: Tbox;
begin
ibox := InvBox(barinfo.SlotToClick);
if not FindColorTolerance(x, y, barinfo.OreColour, ibox.x1, ibox.y1, ibox.x2, ibox.y2, 10) then
begin
Result := True;
if Debug then WriteLn('FailedBank');
Exit;
end;
if barinfo.UsesCoal then
begin
ibox := InvBox(20);
if not FindColorTolerance(x, y, CoalColour, ibox.x1, ibox.y1, ibox.x2, ibox.y2, 10) then
begin
Result := True;
if Debug then WriteLn('FailedBank2');
end;
end;
if not Result then
begin
if Debug then WriteLn('Successfull bank');
end;
end;

Procedure Banking;
begin
if Chest then
OpenBankChestEdge(bankchest)
else
OpenBankFast(bank);

if CoalBag then
Deposit(3, 20, True)
else
Deposit(2, 20, True);

if CoalBag then
begin
if Debug then Writeln('Withdrawing first coal');
MouseBox(397, 99, 415, 115, mouse_right);
if not WaitOption('ithdraw-All', TimeToWait) then
Withdraw(0, 9, 0);

if Debug Then Writeln('filling dat bag');
Mouse(621, 232, 5, 5, mouse_right);
WaitOption('ill', TimeToWait);
end;

if Debug then Writeln('Withdrawing ' + (barinfo.Name));
MouseBox(347, 92, 377, 123, mouse_right);
if not WaitOption('ithdraw-' + IntToStr(barinfo.BarsPerInv), TimeToWait) then
Withdraw(0, 8, barinfo.BarsPerInv);

if barinfo.UsesCoal then
begin
if Debug then Writeln('Withdrawing coal');
MouseBox(397, 99, 415, 115, mouse_right);
if not WaitOption('ithdraw-All', TimeToWait) then
Withdraw(0, 9, 0);
end;
If FailedBank then ResetBank
else
Closebank;
end;

(*Procedure FirstBank;
begin
if Chest then
OpenBankChestEdge(bankchest)
else
OpenBankFast(bank);

if CoalBag then
begin
if Debug then Writeln('Withdrawing first coal');
MouseBox(397, 99, 415, 115, mouse_right);
WaitOption('ithdraw-All', TimeToWait);

if Debug Then Writeln('filling dat bag');
Mouse(621, 232, 5, 5, mouse_right);
WaitOption('ill', TimeToWait);
end;

if Debug then Writeln('Withdrawing ' + (barinfo.Name));
Withdraw(7, 0, barinfo.BarsPerInv);

if barinfo.UsesCoal then
begin
if Debug then Writeln('Withdrawing coal');
MouseBox(397, 99, 415, 115, mouse_right);
ChooseOption('ithdraw-All');
end;

Closebank;
end; *)

Function NoOre: Boolean;
var
x, y: integer;
iBox: Tbox;
Begin
iBox := InvBox(barinfo.SlotToClick);
If not FindColorTolerance(x, y, 3492959, ibox.x1, ibox.y1, ibox.x2, ibox.y2, 10) then
Result := True;
end;

Procedure Heat;
var
T: Integer;
begin
MarkTime(t);
Repeat
InvMouse(barinfo.SlotToClick, 3);
Wait(1000);
Until (TimeFromMark(t)) > 150;
If FailedBank then ResetBank;
if not IsActionBarOpen then ToggleActionBar(True);
if PlayerChatActive then
begin
PressKey(13);
Wait(150+random(200));
PressKey(13);
end;

Repeat
Wait(100+Random(10));
SendKeys('1',100,100);
InvMouse(barinfo.SlotToClick, 1);
until NoOre or (TimeFromMark(T)>100000);
end;

Procedure progress;
var
HeatsHour, MageXp, MageXpHour, TimeRan:Integer;
SmithXp, SmithXpHour: Extended;
begin
TimeRan := (GetTimeRunning / 1000);
Heats := (barinfo.BarsPerInv) * (LoadsDone);
HeatsHour := (3600 * (Heats)) / ((TimeRan));
MageXp := (((Heats) * 53) / 1000);
MageXpHour := (((HeatsHour) * 53) / 1000);
SmithXp := ((Heats) * (barinfo.SmithXpBar) / 1000);
SmithXpHour := (((HeatsHour) * (barinfo.SmithXpBar)) / 1000);

if not Debug then ClearDebug;
Writeln('The Killers Heater');
Writeln((barinfo.Name) + ' Bars made: ' + IntToStr(Heats));
Writeln('Bars per hour: ' + IntToStr(HeatsHour));
Writeln('Time running: ' + TimeRunning);
Writeln('Magic Xp: ' + IntToStr(MageXp) + 'K');
Writeln('Magic Xp Per hour: ' + IntToStr(MageXpHour) + 'K');
Writeln('Smithing Xp: ' + ToStr(SmithXp) + 'K');
Writeln('Smithing Xp Per hour: ' + ToStr(SmithXpHour) + 'K');
End;

begin
ClearDebug;
SRL_SixHourFix := True;
SMART_FixSpeed := True;
If (SRL_SixHourFix) then
SRL_Procs[srl_OnRSUpdate] := @SixHourFix;
SetupSRL;
MouseSpeed:= (SpeedOfMouse);
LoadBarInfo;
DeclarePlayers;

LoginPlayer;
FindNormalRandoms;

ClickNorth(0);
if Chest then
OpenBankChestEdge(bankchest)
else
OpenBankFast(bank);

if not Bankscreen or Pinscreen then
begin
Tries := 0;
Repeat
if Chest then
OpenBankChestEdge(bankchest)
else
OpenBankFast(bank);
InPin(Players[0].Pin);
Inc(Tries);
Until (Tries > 3) or Bankscreen;
end;

if not Pinscreen then
begin
Tries := 0;
Repeat
InPin(Players[0].Pin);
Inc(Tries);
Until (Tries > 3) or Bankscreen;
end;

if Tries > 3 then
begin
Writeln('Entering pin or opening bank has failed');
writeln('logging off...');
Logout;
writeln('Terminating script...');
TerminateScript;
end;

FixBank;
ResetBank;
// FirstBank;
// Heat;
// inc(loadsdone);

Repeat
Banking;
MarkTime(LoadTime);
Heat;
if TimeFromMark(LoadTime) > 3000 then
inc(loadsdone);
Progress;
until Heats > BarsToDo;

Logout;
end.
{==============================================================================}

Sin

2012-12-31 13:23:50

I'm leaning towards a no since I don't see any advanced object finding (or any object finding for that matter).


Function CoalCheck(WithCoalBag, WithoutCoalBag: Integer): Integer;
begin
if Coalbag then
begin
Result := WithCoalBag
end else
begin
Result := WithoutCoalBag
end;
end;

can be shortened to:


Result := WithoutCoalbah
if Coalbag then
Result := WithCoalbag;



Procedure ResetBank;
begin
if not LoggedIn then LoginPlayer;
FindNormalRandoms;
if Chest then
begin
OpenBankChestEdge(bankchest);
end else
begin
OpenBankFast(bank);
end;
If Pinscreen then
Inpin(Players[0].Pin);
FixBank;
is pretty flawed; open the bank, continuously check if the PinScreen is up until the BankScreen is up.

Dynamite

2012-12-31 13:29:03

Didn't really look at script.
Yes from me.

-Boom

J J

2012-12-31 14:02:28

I recently made a superheater and a few days ago I updated it (not here). So I know everything about superheating and what could possibly go wrong.

I like that you use a type (TOreInfo) to store the information, but it is used for "static" slots later. One thing that could go wrong when using a coalbag is that you aren't superheating one ore. Then you withdraw new ores but as there is leftover coal, your inventory will eventually get filled up with coal as the coalbag will be full.

You might have some failsafes implemented but by looking through the code I didn't find any. I don't really like the idea of using inventory slots to click at especially because so many things can go wrong. You are using FindColorTolerance to make sure there are any ores but judging from the script you aren't checking if you are actually clicking on the correct ore. I might be wrong though.

Also some unnecessary code such as here:
Function CoalCheck(WithCoalBag, WithoutCoalBag: Integer): Integer;
begin
if Coalbag then
begin
Result := WithCoalBag
end else
begin
Result := WithoutCoalBag
end;
end;

Function GaulentsCheck: Extended;
begin
if Goldgauntlets then
begin
Result := 56.2;
end else
begin
Result := 22.5;
end;
end;

Function SlotToClick: Integer;
begin
if Coalbag then
begin
Result := barinfo.BarsPerInv + 2;
end else
begin
Result := barinfo.BarsPerInv +1;
end;
end;
Could be:
function CoalCheck: Integer;
begin
if Coalbag then
Result := 1
else
Result := 2;
end;

function GaulentsCheck: Extended;
begin
if Goldgauntlets then
Result := 56.2;
else
Result := 22.5;
end;

function SlotToClick: Integer;
begin
if Coalbag then
Result := barinfo.BarsPerInv + 2;
else
Result := barinfo.BarsPerInv +1;
end;

I don't really like Shay's method, but it is shorter:
Result := WithoutCoalbah
if Coalbag then
Result := WithCoalbag;
But you are always assigning values to the Result and then checking. If you are checking anyways you might aswell do a if/else statement even though it is one extra line. It speeds things up, not noticeable but it should be a little bit faster if you would time it (one million times).
program SpeedTest;
{$i srl/srl.simba}

var
CoalbagValue: Integer;
CoalbagTrue: boolean;
i: Integer;
Start: LongWord;

procedure Method1;
begin
CoalbagValue := 1;
if CoalbagTrue then
CoalbagValue := 2;
end;

procedure Method2;
begin
if CoalbagTrue then
CoalbagValue := 1
else
CoalbagValue := 2;
end;

begin
SetupSRL;
Start := GetTimeRunning
CoalbagTrue := True;
for i:=0 to 1000000 do
Method1;
Writeln('Took: ' + ToStr(GetTimeRunning-Start));
end.

Enough rambling for today. I'm off to a new years party and I'll make my decision tomorrow. Also basing it on the Skype SRL Chat etc :bart:

Gucci

2012-12-31 14:07:55

I like the use of records, but the script still lacks the "complexity" that you would expect for a members application. There are a few places where you could use some failsafes and really improve the stability of your script. You are active around the community and that's a big plus. Will hold my vote for now.

Edit: Voted no, you may be active a lot but your script isn't up to par.

cause

2012-12-31 14:39:40

Sorry but not advanced enough for me. Good job on commenting and presentation.

The Killer

2012-12-31 18:06:41

@jj it does check that it has the correct ores before heating:
Function FailedBank: Boolean;
var
x, y: integer;
ibox: Tbox;
begin
ibox := InvBox(barinfo.SlotToClick);
if not FindColorTolerance(x, y, barinfo.OreColour, ibox.x1, ibox.y1, ibox.x2, ibox.y2, 10) then
begin
Result := True;
if Debug then WriteLn('FailedBank');
Exit;
end;
if barinfo.UsesCoal then
begin
ibox := InvBox(20);
if not FindColorTolerance(x, y, CoalColour, ibox.x1, ibox.y1, ibox.x2, ibox.y2, 10) then
begin
Result := True;
if Debug then WriteLn('FailedBank2');
end;
end;
if not Result then
begin
if Debug then WriteLn('Successfull bank');
end;
end;
and then uses resetbank to correct itself. (while ontopic of resetbank, what do you mean shay, I'm not following. Do you mean changing to:
Procedure ResetBank;
begin
repeat
If Pinscreen then
Inpin(Players[0].Pin);
Until Bankscreen
?

However thanks for the shortening methods jj and shay :)

And to everyone thanks for all feedback so far, appreciate it.

edit: spoke to shay, now see what he means. He means that if the pin isn't stored in info the script will fail. My response was "well they better keep their pin stored in info then ;)".
So to do this I'd do
Repeat
InPin(Players[0].Pin);
Inc(Tries)
Until Tries > 3;

riwu

2013-01-01 03:26:07


Function GaulentsCheck: Extended;
begin
if Goldgauntlets then
begin
Result := 56.2;
end else
begin
Result := 22.5;
end;
end;

Function SlotToClick: Integer;
begin
if Coalbag then
begin
Result := barinfo.BarsPerInv + 2;
end else
begin
Result := barinfo.BarsPerInv +1;
end;
end;
Why not directly assign the variables instead of making these functions and using their results later on ;)



MouseBox(397, 99, 415, 115, mouse_right);
WaitOption('ithdraw-All', TimeToWait);

if Debug Then Writeln('filling dat bag');
Mouse(621, 232, 5, 5, mouse_right);
WaitOption('ill', TimeToWait);
end;

if Debug then Writeln('Withdrawing ' + (barinfo.Name));
MouseBox(347, 92, 377, 123, mouse_right);
WaitOption('ithdraw-' + IntToStr(barinfo.BarsPerInv), TimeToWait);

if barinfo.UsesCoal then
begin
if Debug then Writeln('Withdrawing coal');
MouseBox(397, 99, 415, 115, mouse_right);
WaitOption('ithdraw-All', TimeToWait);
end;
Explore the bank.simba include ;)
Also you should check whether the items (including coal bag) to be withdrawn are indeed in existence before withdrawing them (add a bitmap/dtm variable to the record?).
It seems like you check for them later on after closing the bank, but the check is pretty simple using only a single pixel of color check, which would be vulnerable to false positives.


From: The Killer

edit: spoke to shay, now see what he means. He means that if the pin isn't stored in info the script will fail. My response was "well they better keep their pin stored in info then ".

As many experienced programmers would tell you, always assume that the users are dumb! As much as possible, make your scripts foolproof ;)
You can also check to see if the .Pin string is null.


From: The Killer

note: not all my scripting abiltys are in the script due to the nature of it.
e.g. No Dtms and Walking.

I agree with you that some scripts do not require certain tactics, and it's perfectly fine making these simpler scripts. However, this is your membership application, where you are supposed to demonstrate all the knowledge you possess that you want us to know!

I see no TPA/walking in the script, and i'll have to assume that you don't know them :p So choose a script that will display your real scripting abilities!
The use of records is good though so keep that up!

The Killer

2013-01-01 04:45:26

^thanks, and yeah I can see where your coming from :p,
and I am aware of withdraw (I even use it in first bank :P), but I found it would misclick every now and then, meaning banking would fail more often.

J J

2013-01-01 07:05:42

Oh I see, Simba has those handy functions to convert slots to TBoxes :) After going through it all again and including activity at Skype and the forum I decided to vote Yes.

[XoL]

2013-01-01 12:31:42

To be honest 1500+ posts, and almost a year.
Yes from me :)

The script isn't too bad, and it shows an attempt which tbh is all I care about especially if they have activity like you.

Daniel

2013-01-02 09:30:22

Yes, purely due to your active participation around the forums.

BraK

2013-01-02 14:52:20

You have a tendency to get a little hot headed with newer users. I'll be voting no for now. :(

The Killer

2013-01-02 15:38:13

Updated the script adding things suggested (more failsafes, and shortened if then else)
and slowly adding more failsafes over time

EtherFreak

2013-01-04 00:43:27

Hmm, a fair number of no votes…guess I tied it up with my yes vote…

Sjoe

2013-01-04 11:49:24

From: BraK
You have a tendency to get a little hot headed with newer users. I'll be voting no for now. :(


Too be honest, a lot of members here. In my opinion. Even if it doesn't show.

The Killer

2013-01-04 11:55:34

From: BraK
You have a tendency to get a little hot headed with newer users. I'll be voting no for now. :(

I think that's unfair. I get hot headed with ALL USERS ;)
but on a serious note, sometimes I lose my cool and tbh, a lot of people do. I'v just got to learn not to :P

BraK

2013-01-17 10:53:55

Closed.