SRL Archive - Research & Development Lounge

problems with dedication


Feroc1ty

2010-11-16 17:38:02

although my scripting ability is far from newbie I haven't released a single script to the public (have some private ones but they're outdated), and i think it's mostly due to the fact that I have no dedication towards finishing the scripts, most of the time I finish the project to 80% and quit it, start another project

it gets really annoying, but i figured if i posted on the forums about the script in the making (al-kharid smelter) i'm gonna have for force myself to finish it… so here is my W.I.P

edit: this wip is almost done so if u can test it, it would be cool, all it requires you to do is set up the player setup and have the character waiting at al-kharid bank

program Smelter;

{$i SRL/SRL/Misc/SMART.scar}
{$i SRL/SRL.scar}
{$i reflection/reflection.simba}

// My main concept of the script before I even attempt to create it

{ The program flow :

i = initialization functions, will only run when the script starts
# = scripts main loop, starts at 1 and ends at highest number

x i check if there are any ores in inventory
x i check to see the location of the character
i if the character is at bank
n if the inventory isn't full of ores
fill them up
x i make your way to the smelter
x i smelt the bars
x i walk to the bank

x 1 open bank and deposit items, check to see if character has a forging ring equiped
2 if usage of rings is turned on take one out and wear it, than take out ores
x 3 make your way to the smelter
x 4 smelt the bars
x 5 make your way back

1:
x open the bank
x deposit all items
x click equipment menu on bank and check the ring slot
2:
x revert back to bank menu
if no ring found and its turned on take one and wear it
fill inventory with ores
3:
x use reflection to move to the smelter
i was thinking of creating two boxes of possible clickpoints
and randomly clicking inside them for randomness
x have anti-random inbetween each click
4:
x click smelter and click the iron bars
there will be a long wait so have anti-random every 5 seconds
or something to that extent, also check if the last inventory slot
is not an ore, and when this happens move on to the next step
5:
x move back to the bank and repeat the loop
probably will need another one or two boxes of points, one for
the bank for sure


Updated: Nov 18, 2010 12:28AM

}

function WithdrawOres(Col, Row: Integer): Boolean;
var
BBox: TBox;
X, Y: Integer;
begin
Result := False;

BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
GetMousePos(X, Y);
if (not PointInBox(Point(X, Y), BBox)) then
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 3);

ClickMouse2(false);

Result := WaitOptionMulti(['Withdraw-All', 'w-A'], 300);

end;

const IronOreColor = 1515316;

function FindOres(): Boolean;
var
x, y: integer;
BPoint: TPoint;
BankBox: TBox;
Found: Boolean;
t: TPointArray;
label
Start;
begin
Result := False;
if not BankScreen then Exit;

if (Players[CurrentPlayer].Integers[1] = 0) then
begin
Start:
for Players[CurrentPlayer].Integers[1] := 1 to 50 do
begin
if FindItemEx(x, y, 'color', IronOreColor, BankIndexToMSBox(Players[CurrentPlayer].Integers[1]), [5,20]) then
begin
MMouse(x, y, 4, 4);
if WaitUpTextMulti(['ron, ore','ron ore','ron, '], 300) then
begin
Writeln('Found Item at Bank Slot ' + IntToStr(Players[CurrentPlayer].Integers[1]) + '.');
Found := True;
Break;
end else
Writeln('Found Incorrect Item, Moving to new Bank Spot.');
writeln(getuptext());
end;
end;
end else
begin
BankBox := BankIndexToMSBox(Players[CurrentPlayer].Integers[1]);
FindColors(t, srl_outline_black, BankBox.x1, BankBox.y1, BankBox.x2, BankBox.y2);
BankBox := GetTPABounds(t);
MouseBox(BankBox.x1, BankBox.y1, BankBox.x2, BankBox.y2, 3);
if WaitUpTextMulti(['ron, ore','ron ore','ron, '], 300) then
Found := true
else
begin
Writeln('Item Moved from Bank Slot ' + IntToStr(Players[CurrentPlayer].Integers[1]) + ', checking bank again.');
GoTo Start;
end;
end;
Wait(RandomRange(200, 350));
if Found then
begin
BPoint := BankIndexToBankPoint(Players[CurrentPlayer].Integers[1]);
WithdrawOres(BPoint.x, BPoint.y);
Result := True;
end else
begin
Players[CurrentPlayer].Integers[1] := 0;
end;
end;

function GetOres():boolean;
var i:integer;
begin

result := false;
FixBank;

if Players[CurrentPlayer].Integers[2] = -1 then
begin

FixBankTab;

for i := 0 to 9 do
begin
if not (CurrentBankTab = i) then
begin
if not(i = 0) and not ExistsBankTab(i) then
begin
writeln('Could not find iron ores, went through ' + inttostr(i) + ' bank tabs.');
exit;
end;
if not (i = 0) then
BankTab(i);
Sleep(200+random(200));
end;
if FindOres then
begin
Players[CurrentPlayer].Integers[2] := i;
result := true;
writeln('Found the ore!');
exit;
end;
end;

end else
begin

BankTab(Players[CurrentPlayer].Integers[2]);
if not FindOres then
begin
writeln('Could not find iron ores in the appropriate bank tab!');
Players[CurrentPlayer].Integers[2] := -1;
exit;
end;
result := true;

end;

sleep(200+random(200));

if R_CountItemName('Iron ore') = 0 then
result := false;

end;


procedure DeclarePlayers;
begin
HowManyPlayers := 1; // How many players declared?
CurrentPlayer := 0; // Number of player to start with.
NumberOfPlayers(HowManyPlayers);
with Players[0] do
begin
Name := '*'; // Characters full RS username.
Pass := '*'; // Characters RS password.
Nick := '*'; // 3 non-caps letters of char's RS username.
Member := true; // Is character a member?
Pin := ''; // Characters bank pin if one exists
BoxRewards := ['mote', 'ostume', 'XP', 'Gem',
'ithril', 'oal', 'une', 'oins']; // Which reward to get from box
Integers[0] := 2000; // How many ores to smelt
Active := True;

// ~!~ Don't touch
Integers[1] := 0; // Ores bank index
Integers[2] := -1; // Ores bank tab
end;
end;

// tested and working!
function IsWearingRing():boolean;
begin
result := IsEquippedName('Ring of forging');
end;

// variable for boundaries of smelt all iron bars button
var smeltbars:TBox;
// 235,397:283,452

// function to click a TBox, higher chance to click middle of box
// than outer edges
procedure ClickBox(box:TBox);
var x,y:integer;
begin
x := (box.x2 - box.x1)/2;
y := (box.y2 - box.y1)/2;
Mouse(box.x1 + x + Random(RandomRange(-x,x)), box.y1 + y + Random(RandomRange(-y,y)), 0, 0, true);
end;

var osmelter:TTile;

procedure ClickSmelter();
var p:TPoint;
begin
p := TileToMS(osmelter, 30);
Mouse(p.x,p.y,5,5,true);
Sleep(2500+random(random(500)));
end;

procedure ClickSmeltAll();
begin
ClickBox(smeltbars);
end;

// procedure to take care of smelting all the ores
procedure SmeltAll();
var ores,s:integer;
begin
ClickSmelter;
ClickSmeltAll;
s := R_CountItemName('Iron ore');
Sleep(3000+random(random(500)));
// main procedure loop, will run until out of iron ore
repeat
// counts iron ores, if 0 then exits the procedure
ores := R_CountItemName('Iron ore');
if ores = 0 then
begin
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] - s;
exit;
end;
// if not done smelting will check for randoms and wait a bit
FindNormalRandoms;
Sleep(2500 + random(random(500)));
// checks to see if the ore count is going down, if not
// will recurse the function, after the recursed function is done
// will come back to this one and exit immediatly
if ores = R_CountItemName('Iron ore') then
begin
SmeltAll();
Exit;
end;
until false
end;

procedure DepositBars();
begin
R_DepositAll(true);
end;

procedure Bank();
begin
repeat
Sleep(1500 + Random(random(500)));
until R_OpenBankBooth(Bank_AK)
Wait(1000+Random(500));
if R_PinScreen then
begin
InPin(Players[CurrentPlayer].Pin);
end;
end;

// Box variables, will be used to click a random point on minimap
// within their bounds, makes everything more simple
var tbank,tmid,tsmelt:TBox;
// still need to get values for them, can't do them since I can't
// get a hold of the path maker since simba doesn't download the
// .exe file, simply the .scar/.simba files

// selects a random point in box, clicks to move to the random tile
// and waits for the movement to be finished, doesn't have a timeout
// but the function really shouldn't fail since its so straight forward
procedure MoveToBox(box:TBox);
var tpt:TPoint;
ttl:TTile;
attempts:integer;
begin
// select random point in box and convert the point to a tile
repeat
tpt.x := RandomRange(box.x1, box.x2);
tpt.y := RandomRange(box.y1, box.y2);
ttl := PointToTile(tpt);
sleep(300+random(200));
until TileOnMM(ttl);
// convert the tile to a location on minimap and click it, than wait
// for the movement to finish
tpt := TileToMM(ttl);
Mouse(tpt.x, tpt.y, 2, 2, true);
Sleep(400+random(200));
FindNormalRandoms;
R_Flag;
end;

procedure MoveToBank();
begin
MoveToBox(tmid);
MoveToBox(tbank);
end;

procedure MoveToSmelter();
begin
MoveToBox(tmid);
MoveToBox(tsmelt);
end;

// tbank tl = (3269,3169) br = (3272,3165)
// tmid tl = (3274,3178) br = (3280,3171)
// tsmelt tl = (3276,3188) br = (3281,3184)
// osmelter = (3273,3186)

// not completely sure about these values made a crappy debug
// tool that didnt work for shit lol
procedure InitLocations();
begin
tbank.x1 := 3269; tbank.y1 := 3169;
tbank.x2 := 3272; tbank.y2 := 3165;

tmid.x1 := 3274; tmid.y1 := 3178;
tmid.x2 := 3280; tmid.y2 := 3171;

tsmelt.x1 := 3276; tsmelt.y1 := 3188;
tsmelt.x2 := 3281; tsmelt.y2 := 3184;

smeltbars.x1 := 235; smeltbars.y1 := 397;
smeltbars.x2 := 283; smeltbars.y2 := 452;

osmelter := Tile(3273,3186);
end;

var p:TTile;
terminate:boolean;
tries:integer;

begin
Smart_Members := true;
Smart_Server := 60;
Smart_Signed := true;
Smart_SuperDetail := false;
SetupSRL;
SetupReflection;
ActivateClient;
DeclarePlayers;

terminate := false;
tries := 0;

InitLocations;

if not LoggedIn then
LoginPlayer;

SetAngle(true);


repeat
Bank;
DepositBars;
repeat
tries := tries + 1;
if tries > 5 then
begin
writeln('The script could not find the ores, terminating');
terminate := true;
end;
until GetOres or terminate
if terminate then
exit;
tries := 0;
MoveToSmelter;
SmeltAll;
MoveToBank;
until (Players[CurrentPlayer].Integers[0] <= 0)

writeln('The script has finished doing all your dirty work, congradulations!');

Logout;

end.

Cstrike

2010-11-16 17:50:16

Cool

Hopefully reflection will make it easier :)

Gu3st...

2010-11-16 18:45:46

I tend to do that a lot too, Feroc1ty :/

Try creating functions and procedures for SRL instead :)

Heavenguard

2010-11-16 20:23:06

This tends to happen to me when I get overwhelmed.

Feroc1ty

2010-11-17 13:23:50

Well this post is actually encouraging me to work 1000% the normal pace.

Almost done with it, tested out the walking which is flawless (no duh, its reflection lol!), smelts the bars and walks back, the banking method is done now all I need to do is create my equip ring procedure, add a couple of anti-bans and create a players set up.

EDIT: Currently having problems with finding ores in inventory, I think WithdrawItemEX is broken, since it finds the item correctly but when it's about to take it out it defaults to default tab (tab 0) before doing so killing the whole point (since my scripts goes through every tab to check for the ores, and when it finds that spot it saves the tab number ) and also making the character take out the wrong item (but it would be correct item if the tab remained correct)

EDIT2: Well the script is working now, logs in and smelts, now just need to add some antiban and act human procedures and im done i think :/

Feroc1ty

2010-11-19 15:17:59

Sorry for double post but script has a huge update, now all I need to add is ring of forging usage, some anti-ban, plus some misc stuff such as multiplayer… but I really have no inclination to add that unless people actually use this script as I only have one runescape character; but besides that the script runs pretty well, smelted around 3K ores for me without a problem so far.

Feroc2ty

2010-11-20 01:37:09

was banned so thot id post my last version which has antiban but still doesn't have multiplayer or ring but i wont be on srl for a month LOL some nerds got mad at me, anyways heres it hope u like it

program AlKharidIron;

{$i SRL/SRL/Misc/SMART.scar}
{$i SRL/SRL.scar}
{$i reflection/reflection.simba}

// My main concept of the script before I even attempt to create it

{ The program flow :

i = initialization functions, will only run when the script starts
# = scripts main loop, starts at 1 and ends at highest number

x i check if there are any ores in inventory
x i check to see the location of the character
i if the character is at bank
n if the inventory isn't full of ores
fill them up
x i make your way to the smelter
x i smelt the bars
x i walk to the bank

x 1 open bank and deposit items, check to see if character has a forging ring equiped
2 if usage of rings is turned on take one out and wear it, than take out ores
x 3 make your way to the smelter
x 4 smelt the bars
x 5 make your way back

1:
x open the bank
x deposit all items
x click equipment menu on bank and check the ring slot
2:
x revert back to bank menu
if no ring found and its turned on take one and wear it
fill inventory with ores
3:
x use reflection to move to the smelter
i was thinking of creating two boxes of possible clickpoints
and randomly clicking inside them for randomness
x have anti-random inbetween each click
4:
x click smelter and click the iron bars
there will be a long wait so have anti-random every 5 seconds
or something to that extent, also check if the last inventory slot
is not an ore, and when this happens move on to the next step
5:
x move back to the bank and repeat the loop
probably will need another one or two boxes of points, one for
the bank for sure


Updated: Nov 18, 2010 12:28AM

}


// copied from tickyys vem miner v0.64
procedure AntiBan;
begin
case Random(290) of
0, 110: IdleTime(2000, 1000, 0.2);
10, 120: HoverSkill('Smithing', False);
30, 140: RandomRClick;
40, 150: PickUpMouse;
50, 160: RandomMovement;
60, 170: BoredHuman;
70, 180: MMouse(RandomRange(-100, 800), RandomRange(-100, 800), 0, 0);
80, 190: SleepAndMoveMouse(2000+Random(1000));
90, 200: GameTab(RandomRange(20, 36));
100, 210: ExamineInv;
end;
end;

function WithdrawOres(Col, Row: Integer): Boolean;
var
BBox: TBox;
X, Y: Integer;
begin
Result := False;

BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
GetMousePos(X, Y);
if (not PointInBox(Point(X, Y), BBox)) then
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 3);

ClickMouse2(false);

Result := WaitOptionMulti(['Withdraw-All', 'w-A'], 300);

end;

const IronOreColor = 1515316;

function FindOres(): Boolean;
var
x, y: integer;
BPoint: TPoint;
BankBox: TBox;
Found: Boolean;
t: TPointArray;
label
Start;
begin
Result := False;
if not BankScreen then Exit;

if (Players[CurrentPlayer].Integers[1] = 0) then
begin
Start:
for Players[CurrentPlayer].Integers[1] := 1 to 50 do
begin
if FindItemEx(x, y, 'color', IronOreColor, BankIndexToMSBox(Players[CurrentPlayer].Integers[1]), [5,20]) then
begin
MMouse(x, y, 4, 4);
if WaitUpTextMulti(['ron, ore','ron ore','ron, '], 300) then
begin
Writeln('Found Item at Bank Slot ' + IntToStr(Players[CurrentPlayer].Integers[1]) + '.');
Found := True;
Break;
end else
Writeln('Found Incorrect Item, Moving to new Bank Spot.');
writeln(getuptext());
end;
end;
end else
begin
BankBox := BankIndexToMSBox(Players[CurrentPlayer].Integers[1]);
FindColors(t, srl_outline_black, BankBox.x1, BankBox.y1, BankBox.x2, BankBox.y2);
BankBox := GetTPABounds(t);
MouseBox(BankBox.x1, BankBox.y1, BankBox.x2, BankBox.y2, 3);
if WaitUpTextMulti(['ron, ore','ron ore','ron, '], 300) then
Found := true
else
begin
Writeln('Item Moved from Bank Slot ' + IntToStr(Players[CurrentPlayer].Integers[1]) + ', checking bank again.');
GoTo Start;
end;
end;
Wait(RandomRange(200, 350));
if Found then
begin
BPoint := BankIndexToBankPoint(Players[CurrentPlayer].Integers[1]);
WithdrawOres(BPoint.x, BPoint.y);
Result := True;
end else
begin
Players[CurrentPlayer].Integers[1] := 0;
end;
end;

function GetOres():boolean;
var i:integer;
begin

result := false;
FixBank;

if Players[CurrentPlayer].Integers[2] = -1 then
begin

FixBankTab;

for i := 0 to 9 do
begin
if not (CurrentBankTab = i) then
begin
if not(i = 0) and not ExistsBankTab(i) then
begin
writeln('Could not find iron ores, went through ' + inttostr(i) + ' bank tabs.');
exit;
end;
if not (i = 0) then
BankTab(i);
Sleep(200+random(200));
end;
if FindOres then
begin
Players[CurrentPlayer].Integers[2] := i;
result := true;
writeln('Found the ore!');
exit;
end;
end;

end else
begin

BankTab(Players[CurrentPlayer].Integers[2]);
if not FindOres then
begin
writeln('Could not find iron ores in the appropriate bank tab!');
Players[CurrentPlayer].Integers[2] := -1;
exit;
end;
result := true;

end;

sleep(200+random(200));

if R_CountItemName('Iron ore') = 0 then
result := false;

end;


procedure DeclarePlayers;
begin
HowManyPlayers := 1; // How many players declared?
CurrentPlayer := 0; // Number of player to start with.
NumberOfPlayers(HowManyPlayers);
with Players[0] do
begin
Name := '*'; // Characters full RS username.
Pass := '*'; // Characters RS password.
Nick := '*'; // 3 non-caps letters of char's RS username.
Member := true; // Is character a member?
Pin := ''; // Characters bank pin if one exists
BoxRewards := ['mote', 'ostume', 'XP', 'Gem',
'ithril', 'oal', 'une', 'oins']; // Which reward to get from box
Integers[0] := 2000; // How many ores to smelt
Active := True;

// ~!~ Don't touch
Integers[1] := 0; // Ores bank index
Integers[2] := -1; // Ores bank tab
end;
end;

// tested and working!
function IsWearingRing():boolean;
begin
result := IsEquippedName('Ring of forging');
end;

// variable for boundaries of smelt all iron bars button
var smeltbars:TBox;
// 235,397:283,452

// function to click a TBox, higher chance to click middle of box
// than outer edges
procedure ClickBox(box:TBox);
var x,y:integer;
begin
x := (box.x2 - box.x1)/2;
y := (box.y2 - box.y1)/2;
Mouse(box.x1 + x + Random(RandomRange(-x,x)), box.y1 + y + Random(RandomRange(-y,y)), 0, 0, true);
end;

var osmelter:TTile;

procedure ClickSmelter();
var p:TPoint;
begin
p := TileToMS(osmelter, 30);
Mouse(p.x,p.y,5,5,true);
Sleep(2500+random(random(500)));
end;

procedure ClickSmeltAll();
begin
ClickBox(smeltbars);
end;

// procedure to take care of smelting all the ores
procedure SmeltAll();
var ores,s:integer;
begin
ClickSmelter;
ClickSmeltAll;
s := R_CountItemName('Iron ore');
Sleep(3000+random(random(500)));
// main procedure loop, will run until out of iron ore
repeat
// counts iron ores, if 0 then exits the procedure
ores := R_CountItemName('Iron ore');
if ores = 0 then
begin
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] - s;
exit;
end;
// if not done smelting will check for randoms and wait a bit
FindNormalRandoms;
Antiban;
Sleep(2500 + random(random(500)));
// checks to see if the ore count is going down, if not
// will recurse the function, after the recursed function is done
// will come back to this one and exit immediatly
if ores = R_CountItemName('Iron ore') then
begin
SmeltAll();
Exit;
end;
until false
end;

procedure DepositBars();
begin
R_DepositAll(true);
end;

procedure Bank();
begin
repeat
Sleep(1500 + Random(random(500)));
until R_OpenBankBooth(Bank_AK)
Wait(1000+Random(500));
if R_PinScreen then
begin
InPin(Players[CurrentPlayer].Pin);
end;
end;

// Box variables, will be used to click a random point on minimap
// within their bounds, makes everything more simple
var tbank,tmid,tsmelt:TBox;
// still need to get values for them, can't do them since I can't
// get a hold of the path maker since simba doesn't download the
// .exe file, simply the .scar/.simba files

// selects a random point in box, clicks to move to the random tile
// and waits for the movement to be finished, doesn't have a timeout
// but the function really shouldn't fail since its so straight forward
procedure MoveToBox(box:TBox);
var tpt:TPoint;
ttl:TTile;
attempts:integer;
begin
// select random point in box and convert the point to a tile
repeat
tpt.x := RandomRange(box.x1, box.x2);
tpt.y := RandomRange(box.y1, box.y2);
ttl := PointToTile(tpt);
sleep(300+random(200));
until TileOnMM(ttl);
// convert the tile to a location on minimap and click it, than wait
// for the movement to finish
tpt := TileToMM(ttl);
Mouse(tpt.x, tpt.y, 2, 2, true);
Sleep(400+random(200));
FindNormalRandoms;
R_Flag;
end;

procedure MoveToBank();
begin
MoveToBox(tmid);
MoveToBox(tbank);
end;

procedure MoveToSmelter();
begin
MoveToBox(tmid);
MoveToBox(tsmelt);
end;

// tbank tl = (3269,3169) br = (3272,3165)
// tmid tl = (3274,3178) br = (3280,3171)
// tsmelt tl = (3276,3188) br = (3281,3184)
// osmelter = (3273,3186)

// not completely sure about these values made a crappy debug
// tool that didnt work for shit lol
procedure InitLocations();
begin
tbank.x1 := 3269; tbank.y1 := 3169;
tbank.x2 := 3272; tbank.y2 := 3165;

tmid.x1 := 3274; tmid.y1 := 3178;
tmid.x2 := 3280; tmid.y2 := 3171;

tsmelt.x1 := 3276; tsmelt.y1 := 3188;
tsmelt.x2 := 3281; tsmelt.y2 := 3184;

smeltbars.x1 := 235; smeltbars.y1 := 397;
smeltbars.x2 := 283; smeltbars.y2 := 452;

osmelter := Tile(3273,3186);
end;

var p:TTile;
terminate:boolean;
tries:integer;

begin
Smart_Members := true;
Smart_Server := 60;
Smart_Signed := true;
Smart_SuperDetail := false;
SetupSRL;
SetupReflection;
ActivateClient;
DeclarePlayers;

terminate := false;
tries := 0;

InitLocations;

if not LoggedIn then
LoginPlayer;

SetAngle(true);


repeat
Bank;
DepositBars;
repeat
tries := tries + 1;
if tries > 5 then
begin
writeln('The script could not find the ores, terminating');
terminate := true;
end;
until GetOres or terminate
if terminate then
exit;
tries := 0;
MoveToSmelter;
SmeltAll;
MoveToBank;
until (Players[CurrentPlayer].Integers[0] <= 0)

writeln('The script has finished doing all your dirty work, congradulations!');

Logout;

end.

Runescape Pro

2010-11-20 02:05:43

Ban evasion doesn't help your case. AFAIK you were suspended for your attitude.

weezy

2010-11-21 03:24:50

was looking through code and i managed to update it to smithing just changed up names and values hope you dont mind

edit: made the code more adjustable

program VarrockSmither;

{$i SRL/SRL/Misc/SMART.scar}
{$i SRL/SRL.scar}
{$i reflection/reflection.simba}

// if you wish to adjust the code to smith your own crap what you need to adjust are:
// change the BAR_ID to your bars used ID, BAR_NAME, add a different bar color also
// adding it to smithingsetup, after you've adjusted that the only remaining step is to
// go to InitLocations procedure to replace smithknife TBox with bounds of whatever
// item you're gonna go smith... have fun smithing found this code to be pretty neat
// and very adjustable

// by weezy


const

BAR_NAME = 'Iron bar';
BAR_ID = 2354;

BAR_COLOR_IRON = 5395029;

IRON_THROWING_KNIFE = 863;

HAMMER_ID = 2347;

BANK_LOC = 'vwb';



var p:TTile;
terminate:boolean;
tries:integer;
BarColor:integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1; // How many players declared?
CurrentPlayer := 0; // Number of player to start with.
NumberOfPlayers(HowManyPlayers);
with Players[0] do
begin
Name := ''; // Characters full RS username.
Pass := ''; // Characters RS password.
Nick := ''; // 3 non-caps letters of char's RS username.
Member := false; // Is character a member?
Pin := '1337'; // Characters bank pin if one exists
BoxRewards := ['mote', 'ostume', 'XP', 'Gem',
'ithril', 'oal', 'une', 'oins']; // Which reward to get from box
Integers[0] := 1000; // How many bars to smith
Strings[0] := 'iron'; // which bars to smelt, currently only have values for iron
Active := True;

// ~!~ Don't touch
Integers[1] := 0; // Bars bank index
Integers[2] := -1; // Bars bank tab
end;
end;

procedure SmithingSetup;
begin
case Players[CurrentPlayer].Strings[0] of
'iron': BarColor := BAR_COLOR_IRON;
end;
end;



// copied from tickyys vem miner v0.64
procedure AntiBan;
begin
case Random(290) of
0, 110: IdleTime(2000, 1000, 0.2);
10, 120: HoverSkill('Smithing', False);
30, 140: RandomRClick;
40, 150: PickUpMouse;
50, 160: RandomMovement;
60, 170: BoredHuman;
70, 180: MMouse(RandomRange(-100, 800), RandomRange(-100, 800), 0, 0);
80, 190: SleepAndMoveMouse(2000+Random(1000));
90, 200: GameTab(RandomRange(20, 36));
100, 210: ExamineInv;
end;
end;

var breaktime:longint;

procedure TakeBreak;
begin
if GetSystemTime > breaktime then
begin
if breaktime = 0 then
begin
breaktime := GetSystemTime + 18000000 + random(3600000);
exit;
end;
Sleep(3600000+random(360000));
breaktime := GetSystemTime + 18000000 + random(3600000);
if not LoggedIn then
LoginPlayer;
end;
end;

function WithdrawBars(Col, Row: Integer): Boolean;
var
BBox: TBox;
X, Y: Integer;
begin
Result := False;

BBox := BankIndexToMSBox(BankPointToBankIndex(Point(Col, Row)));
GetMousePos(X, Y);
if (not PointInBox(Point(X, Y), BBox)) then
MouseBox(BBox.X1 + 5, BBox.Y1 + 5, BBox.X2 - 5, BBox.Y2 - 5, 3);

ClickMouse2(false);

Result := WaitOptionMulti(['Withdraw-All', 'w-A'], 300);

end;

// need to get color
var IronBarUptext:TStringArray;

function FindBars(): Boolean;
var
x, y: integer;
BPoint: TPoint;
BankBox: TBox;
Found: Boolean;
t: TPointArray;
label
Start;
begin
Result := False;
if not BankScreen then Exit;

if (Players[CurrentPlayer].Integers[1] = 0) then
begin
Start:
for Players[CurrentPlayer].Integers[1] := 1 to 50 do
begin
if FindItemEx(x, y, 'color', BarColor, BankIndexToMSBox(Players[CurrentPlayer].Integers[1]), [8,40]) then
begin
MMouse(x, y, 4, 4);
if WaitUpTextMulti(IronBarUptext, 300) then
begin
Writeln('Found Item at Bank Slot ' + IntToStr(Players[CurrentPlayer].Integers[1]) + '.');
Found := True;
Break;
end else
Writeln('Found Incorrect Item, Moving to new Bank Spot.');
writeln(getuptext());
end;
end;
end else
begin
BankBox := BankIndexToMSBox(Players[CurrentPlayer].Integers[1]);
FindColors(t, srl_outline_black, BankBox.x1, BankBox.y1, BankBox.x2, BankBox.y2);
BankBox := GetTPABounds(t);
MouseBox(BankBox.x1, BankBox.y1, BankBox.x2, BankBox.y2, 3);
if WaitUpTextMulti(IronBarUptext, 300) then
Found := true
else
begin
Writeln('Item Moved from Bank Slot ' + IntToStr(Players[CurrentPlayer].Integers[1]) + ', checking bank again.');
GoTo Start;
end;
end;
Wait(RandomRange(200, 350));
if Found then
begin
BPoint := BankIndexToBankPoint(Players[CurrentPlayer].Integers[1]);
WithdrawBars(BPoint.x, BPoint.y);
Result := True;
end else
begin
Players[CurrentPlayer].Integers[1] := 0;
end;
end;

function GetBars():boolean;
var i:integer;
begin

result := false;
FixBank;

if Players[CurrentPlayer].Integers[2] = -1 then
begin

FixBankTab;

for i := 0 to 9 do
begin
if not (CurrentBankTab = i) then
begin
if not(i = 0) and not ExistsBankTab(i) then
begin
writeln('Could not find iron bars, went through ' + inttostr(i) + ' bank tabs.');
exit;
end;
if not (i = 0) then
BankTab(i);
Sleep(200+random(200));
end;
if FindBars then
begin
Players[CurrentPlayer].Integers[2] := i;
result := true;
writeln('Found the bars!');
exit;
end;
end;

end else
begin

BankTab(Players[CurrentPlayer].Integers[2]);
if not FindBars then
begin
writeln('Could not find iron bars in the appropriate bank tab!');
Players[CurrentPlayer].Integers[2] := -1;
exit;
end;
result := true;

end;

sleep(200+random(200));

if R_CountItemName(BAR_NAME) = 0 then
result := false;

end;

// variable for boundaries of smelt iron throwing knifes button
var smithknife:TBox;
// need to get

// function to click a TBox, higher chance to click middle of box
// than outer edges
procedure ClickBox(box:TBox;left:boolean);
var x,y:integer;
begin
x := (box.x2 - box.x1)/2;
y := (box.y2 - box.y1)/2;
Mouse(box.x1 + x + Random(RandomRange(-x,x)), box.y1 + y + Random(RandomRange(-y,y)), 0, 0, left);
end;

var oanvil:TTile;

procedure ClickAnvil();
var p:TPoint;
begin
R_ClickItemName(BAR_NAME, true, '');
p := TileToMS(oanvil, 10);
MMouse(p.x,p.y,5,5);
writeln(R_GetUpText);
if pos('nvil', R_GetUpText) <> 0 then
begin
ClickMouse2(true);
end else
begin
ClickMouse2(false);
R_ChooseOptionMulti(['nvil']);
end;
Sleep(2500+random(random(500)));
end;

procedure ClickSmithAll();
begin
ClickBox(smithknife,false);
Sleep(200+random(200));
R_ChooseOptionMulti(['ke Al']);
end;

// procedure to take care of smelting all the ores
procedure SmithAll();
var bars,s:integer;
begin
ClickAnvil;
ClickSmithAll;
s := R_CountItemName(BAR_NAME);
Sleep(3000+random(random(500)));
// main procedure loop, will run until out of iron ore
repeat
// counts iron ores, if 0 then exits the procedure
bars := R_CountItemName(BAR_NAME);
if bars = 0 then
begin
Players[CurrentPlayer].Integers[0] := Players[CurrentPlayer].Integers[0] - s;
exit;
end;
// if not done smelting will check for randoms and wait a bit
FindNormalRandoms;
Antiban;
Sleep(2500 + random(random(500)));
// checks to see if the ore count is going down, if not
// will recurse the function, after the recursed function is done
// will come back to this one and exit immediatly
if bars = R_CountItemName(BAR_NAME) then
begin
SmithAll();
Exit;
end;
until false
end;

procedure DepositAllButIDExAdj(IDs : TIntegerArray);
var
I : Integer;
Item : TInvItem;
begin
for I := 1 to 28 do
begin
Item := GetInvItemAt(I);
if(InIntArray(IDs, Item.ID))then Continue;
if not R_ClickItem(I, False, 'Deposit-All') then
R_ClickItem(I, False, 'Deposit');
end;
end;

procedure Bank();
begin

if R_CountItemName(BAR_NAME) > 20 then
exit;

repeat
Sleep(1500 + Random(random(500)));
until R_OpenBankBooth(BANK_LOC)
Wait(1000+Random(500));
if R_PinScreen then
begin
InPin(Players[CurrentPlayer].Pin);
end;

DepositAllButIDExAdj([BAR_ID,HAMMER_ID,IRON_THROWING_KNIFE]);

repeat
tries := tries + 1;
if tries > 5 then
begin
writeln('The script could not find the ores, terminating');
terminate := true;
end;
until GetBars or terminate

end;

// Box variables, will be used to click a random point on minimap
// within their bounds, makes everything more simple
var tbank,tanvil:TBox;
// still need to get values for them, can't do them since I can't
// get a hold of the path maker since simba doesn't download the
// .exe file, simply the .scar/.simba files

// selects a random point in box, clicks to move to the random tile
// and waits for the movement to be finished, doesn't have a timeout
// but the function really shouldn't fail since its so straight forward
procedure MoveToBox(box:TBox);
var tpt:TPoint;
ttl:TTile;
attempts:integer;
begin
// select random point in box and convert the point to a tile
repeat
tpt.x := RandomRange(box.x1, box.x2);
tpt.y := RandomRange(box.y1, box.y2);
ttl := PointToTile(tpt);
sleep(300+random(200));
until TileOnMM(ttl);
// convert the tile to a location on minimap and click it, than wait
// for the movement to finish
tpt := TileToMM(ttl);
Mouse(tpt.x, tpt.y, 2, 2, true);
Sleep(400+random(200));
FindNormalRandoms;
R_Flag;
end;

procedure MoveToBank();
begin
MoveToBox(tbank);
end;

procedure MoveToAnvil();
begin
MoveToBox(tanvil);
end;

// tbank tl = (3184,3440) br = (3189,3435)
// tanvil tl = (3185,3427) br = (3189,3423)
// oanvil = (3188,3426)

// not completely sure about these values made a crappy debug
// tool that didnt work for shit lol
procedure InitLocations();
begin

IronBarUptext := ['n, bar','n bar'];

tbank.x1 := 3184; tbank.y1 := 3440;
tbank.x2 := 3189; tbank.y2 := 3435;

tanvil.x1 := 3185; tanvil.y1 := 3427;
tanvil.x2 := 3189; tanvil.y2 := 3423;

smithknife.x1 := 138; smithknife.y1 := 223;
smithknife.x2 := 238; smithknife.y2 := 250;

oanvil := Tile(3188,3426);
end;

begin
Smart_Members := true;
Smart_Server := 60;
Smart_Signed := true;
Smart_SuperDetail := false;
SetupSRL;
SetupReflection;
ActivateClient;
DeclarePlayers;

terminate := false;
tries := 0;
breaktime := 0;

InitLocations;
SmithingSetup;

if not LoggedIn then
LoginPlayer;

if LobbyScreen then
LoginPlayer;

SetAngle(true);


repeat
TakeBreak;
Bank;
MoveToAnvil;
SmithAll;
MoveToBank;
until (Players[CurrentPlayer].Integers[0] <= 0)

writeln('The script has finished doing all your dirty work, congradulations!');

Logout;

end.

Runescape Pro

2010-11-21 03:51:14

That's pretty funny man. Evading your ban with 2 different accounts. It's not hard to tell that you are in fact "Feroc1ty" AND "Feroc2ty"… 1 post count, just joined.

Take the suspension like a man.

Overtime

2010-11-21 03:53:41

Already Pm'ed Fakawi about it.