SRL Archive - Archive

IPwnz - SRL Member Application


IPwnz

2011-02-18 00:11:45

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
Visual Basic, Pascal, HTML, CSS, some Javascript (kind of holding off on learning more till college)


Are you a member of any other communities?
No (not Runescape or botting related)


Tell us about yourself…
From: IPwnz
I'm a senior in high school now, but I started playing RS back in 6th grade. I had absolutely no idea botting existed for years. I returned for a couple months before they killed free trade and, by reading through some old posts, was generally unhelpful scripting-wise. :) This time around, I'm back because of free trade again, but with my college major as a Game Designer, I hope to grow my scripting abilities in the wonderfully welcome SRL community. I've already had a great time talking with people on the IRC and the forums, and even if I don't make members thank you for providing such a great place for programmers to collaborate and share, because this isn't just about botting Runescape, it's about working through one challenge after another, both as programmers and as people.



Please show us one (or multiple) of your scripts.
program EdgevilleSmelterbyIPwnz;
//*******************************\\
// Edgeville Smelter by IPwnz \\
// version 2.1 \\
// last updated Feburary 17, 2011\\
//*******************************\\
// Setup \\
// Fill in lines 26-27 \\
// and your players. \\
// Start in Edge bank \\
// Hit The Start Button \\
//*******************************\\
// IMPORTANT: \\
// Remember that to use \\
// the Edgeville furnace you \\
// have to have done any task \\
// set in Varrock. \\
//*******************************\\
{$DEFINE SMART}
{$i srl/srl.scar}
{$i srl/srl/misc/stats.simba}
{$i reflection/reflection.simba}

const //(optional) if you want to use SRL Stats, input your info here
StatsUser = ''; //Your SRL Stats Username ([url]http://stats.villavu.com[/url])
StatsPass = ''; //Your SRL Stats Password
ScriptVersion = '2.1'; //Don't touch :)

type //Ignore this stuff
OptionsRecord = record
Loads,Break,TimeTotal,StartXP,TotalXP,CompletedLoads,Ore,Ore2,Bar,BarsInLoad,TotalBars: Integer;
BarType: String;
end;

var //Ignore this too
Options:array[0..99] of OptionsRecord;
BreakTime,TimeMark,PlayerNumber,CurrentOre:Integer;

procedure DeclarePlayers; //Set your players up here
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

Players[0].Name := ''; // Username
Players[0].Pass := '5'; // Password
Players[0].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[0].Active := True; //Set to false only if you don't want to use this character
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
Options[0].Loads := 0; //how many loads to do, 0 for unlimited
Options[0].Break := 0; //Take a break every X hours? 0 for unlimited
Options[0].BarType := 'steel'; //bronze,iron,steel,mithril,adamant,rune,silver,gold

{
Players[1].Name := ''; // Username
Players[1].Pass := ''; // Password
Players[1].Nick := ''; // 3-4 lowercase letters from username; used for random event detection
Players[1].Active := True;
Players[1].Pin := ''; // Leave blank if the player doesn't have a bank pin
Options[1].Loads := 0; //how many loads to do, 0 for unlimited
Options[1].Break := 0; //Take a break every X hours? 0 for unlimited
Options[1].BarType := 'steel'; //bronze,iron,steel,cannonballs,mithril,adamant,rune,silver,gold
}
end;

{Don't touch anything beyond this point}

const
BronzeBarID = 2349;
IronBarID = 2351;
SteelBarID = 2353;
MithrilBarID = 2359;
AdamantineBarID = 2361;
RuniteBarID = 2363;
SilverBarID = 2355;
GoldBarID = 2357;
TinOreID = 438;
CopperOreID = 436;
IronOreID = 440;
IronOreID2 = 440;
CoalOreID = 453;
CoalOreID2 = 453;
CoalOreID3 = 453;
CoalOreID4 = 453;
MithrilOreID = 447;
AdamantineOreID = 449;
RuniteOreID = 451;
SilverOreID = 442;
GoldOreID = 444;
CBallID = 2;
CBallMouldID = 4;
FurnaceID = 26814;

procedure XPCalculator;
var
XPIncrease: Integer;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

XPIncrease := GetXP(skill_Smithing);
Options[CurrentPlayer].TotalXP := XPIncrease - Options[CurrentPlayer].StartXP;
end;

procedure Antiban; //idea based on Coh3n's Antiban
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

case Random(80) of
12: RandomRClick;
24: XPCalculator;
36: PickUpMouse;
48: RandomMovement;
60: BoredHuman;
72: ExamineInv;
end;
end;

procedure LoadCalculator;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

Options[CurrentPlayer].BarsInLoad := R_CountItem(Options[CurrentPlayer].Bar);
Options[CurrentPlayer].CompletedLoads := Options[CurrentPlayer].CompletedLoads + 1;
if not (Options[CurrentPlayer].Ore = SteelBarID) then
Options[CurrentPlayer].TotalBars := Options[CurrentPlayer].TotalBars + Options[CurrentPlayer].BarsInLoad
else
Options[CurrentPlayer].TotalBars := Options[CurrentPlayer].TotalBars + GetItemStackSizeAt(2);
Writeln('Done smelting load #' +ToStr(Options[CurrentPlayer].CompletedLoads));
if not (Options[CurrentPlayer].Ore = SteelBarID) then
Writeln('Smelted a total of ' + ToStr(Options[CurrentPlayer].TotalBars) + ' bars')
else
Writeln('Smelted a total of ' + ToStr(Options[CurrentPlayer].TotalBars) + ' cannonballs');
end;

procedure ProgressReport;
begin
XPCalculator;

Writeln('+ + + + + + + + + + + + +');
Writeln('+ Edgeville Smelter +');
Writeln('+ by IPwnz +');
Writeln('+ Version '+ToStr(ScriptVersion)+' +');
Writeln('+ + + + + + + + + + + + +');
Writeln('');
Writeln('Ran for ' + TimeRunning);
if not (Options[CurrentPlayer].Ore = SteelBarID) then
Writeln('Smelted ' + IntToStr(Options[CurrentPlayer].TotalBars) + ' '
+ ToStr(Options[CurrentPlayer].BarType) +' bars')
else
Writeln('Smelted a total of ' + ToStr(Options[CurrentPlayer].TotalBars) + ' cannonballs');
Writeln('Completed ' + IntToStr(Options[CurrentPlayer].CompletedLoads) + ' loads');
Writeln('Gained a total of ' + IntToStr(Options[CurrentPlayer].TotalXP) + ' XP');
Writeln('');
Writeln('+++++++++++++++++++++++++');
end;

procedure DoChecks; //modified from Travs Ess Miner
var
run: Integer;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;
{$IFDEF REFLECTION}
R_FindRandoms;
{$ELSE}
FindNormalRandoms;
{$ENDIF}
if(Options[CurrentPlayer].Loads >= Options[CurrentPlayer].CompletedLoads) and (Options[CurrentPlayer].Loads <> 0) then
begin
writeln('Player has finished their loads, switching players');
ProgressReport;
NextPlayer(false);
Exit;
end;

if(TimeMark=0) then
MarkTime(TimeMark)
else
begin
Options[CurrentPlayer].TimeTotal := Options[CurrentPlayer].TimeTotal+TimeFromMark(TimeMark);
MarkTime(TimeMark);
end;

MakeCompass('n');
SetAngle(True);
{$IFDEF REFLECTION}
run := R_GetMMLevels('run');
if(run > 30+random(10)) and (not R_IsRunning) then
SetRun(true);
{$ELSE}
if (GetMMLevels('run', cs) > 30) then
SetRun(true);
{$ENDIF}
end;

function Walk(Color, Tolerance: Integer; SortFrom: tpoint): Boolean;
var //Camaro's walking function
i, x, y, rx, ry: Integer;
TPA: TPointArray;
begin
if not LoggedIn then Exit;
FindNormalRandoms;
FindColorsSpiralTolerance(MMCX, MMCY, TPA, Color, MMX1, MMY1, MMX2, MMY2, Tolerance);
SortTPAFrom(TPA, SortFrom);

for i := 0 to High(TPA) do
begin
x := TPA[i].x;
y := TPA[i].y;

rx := RandomRange(-6, 6);
ry := RandomRange(-6, 6);
if (not rs_OnMinimap(x + rx, y + ry)) then
Continue;

Mouse(x + rx, y + ry, 0, 0, true);
FFlag(0);
Wait(200 + Random(500));
Result := True;
Break;
end;
end;

procedure BanktoFurnace;
var
Path: TTile;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

Writeln('Walking to the furnace');
{$IFDEF REFLECTION}
Path := Tile(3109, 3502);
WalktoTile(Path, 1, 1);
{$ELSE}
if not (Walk(16777215, 23, Point(675, 84))) then
Walk(5922400, 23, Point(676, 63));
{$ENDIF}
FFlag(5);
Wait(1000+random(500));
end;

procedure FurnacetoBank;
var
Path: TTile;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

Writeln('Walking to the bank');
{$IFDEF REFLECTION}
Path := Tile(3098, 3496);
WalktoTile(Path, 1, 1);
{$ELSE}
if not (Walk(16711422, 23, Point(675, 62))) then
Walk(7107698, 23, Point(623, 84));
{$ENDIF}
FFlag(5);
Wait(200+random(400));
end;

procedure OrePicker;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

Options[CurrentPlayer].Ore := 0;
Options[CurrentPlayer].Ore2 := 0;
case Lowercase(Options[CurrentPlayer].BarType) of

'bronze', 'tin', 'copper':
begin
Options[CurrentPlayer].Ore := TinOreID;
Options[CurrentPlayer].Ore2 := CopperOreID;
Options[CurrentPlayer].Bar := BronzeBarID;
end;

'iron':
begin
Options[CurrentPlayer].Ore := IronOreID;
Options[CurrentPlayer].Bar := IronBarID;
end;

'steel', 'stel', 'steal':
begin
Options[CurrentPlayer].Ore := IronOreID2;
Options[CurrentPlayer].Ore2 := CoalOreID;
Options[CurrentPlayer].Bar := SteelBarID;
end;

'cannonballs', 'cannonball', 'cball', 'cballs':
begin
Options[CurrentPlayer].Ore := SteelBarID;
Options[CurrentPlayer].Bar := CBallID;
end;

'mith', 'mithril':
begin
Options[CurrentPlayer].Ore := MithrilOreID;
Options[CurrentPlayer].Ore2 := CoalOreID2;
Options[CurrentPlayer].Bar := MithrilBarID;
end;

'adament', 'adamant', 'adamantine', 'that green one':
begin
Options[CurrentPlayer].Ore := AdamantineOreID;
Options[CurrentPlayer].Ore2 := CoalOreID3;
Options[CurrentPlayer].Bar := AdamantineBarID;
end;

'rune', 'runite', 'runeite':
begin
Options[CurrentPlayer].Ore := RuniteOreID;
Options[CurrentPlayer].Ore2 := CoalOreID4;
Options[CurrentPlayer].Bar := RuniteBarID;
end;

'gold', 'golden':
begin
Options[CurrentPlayer].Ore := GoldOreID;
Options[CurrentPlayer].Bar := GoldBarID;
end;

'silver', 'sliver', 'shiny':
begin
Options[CurrentPlayer].Ore := SilverOreID;
Options[CurrentPlayer].Bar := SilverBarID;
end else
begin
Writeln('Please pick a bar type that actually exists');
ProgressReport;
NextPlayer(false);
Exit;
end;
end;
end;

function InSmelter: Boolean;
var
Area: TBox;
NPCCheck: TNPC;
SEPoint, NWPoint, MP: TPoint;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

SEPoint := TileToMM(Point(3109+1, 3498-1));
NWPoint := TileToMM(Point(3109+1, 3503-1));
Area := PointToBox(SEPoint, NWPoint);
MP := TileToMM(GetMyPos);
Result := PointInBox(MP, Area);

if not Result then
if FindNPC(637, NPCCheck) then
Result := True;
end;

procedure LocateFurnace;
var
Furnace: TRSObject;
x, y: Integer;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

Furnace := GetInteractableAt(Tile(3110, 3502));
if Furnace.ID = FurnaceID then
begin
Writeln('Found the furnace');
Exit;
end;

if not Furnace.ID = FurnaceID then
begin
if not FindObjEx(x, y, ['ace', 'urn'], [2702428, 2768223], 5, 50, 0, 0, 515, 337)
and not InSmelter then
begin
writeln('Not in the right room, attempting to walk to it');
DoChecks;
BanktoFurnace;
if not InSmelter then
begin
Writeln('Time to give up, cannot find the furnace');
ProgressReport;
NextPlayer(false);
Exit;
end;
end else
Writeln('All better now, found the furnace');
end;
end;

function SmeltingScreen: Boolean;
begin
Result := GetTextAtEx(14, 352, 5, SmallChars, True, False, 0, 0, 16777215, 3, True, tr_Letters) = 'How';
if not Result and (GetColor(211, 359) = 16777215) then
Result := True; //cannonball smelt check since the screen is different
end;

procedure Smelt;
var
TP : TPoint;
Item: TInvItem;
i, j, clickchoice, timeout, x, y: Integer;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;
i := 0;
j := 0;
timeout :=0;
clickchoice := Random(4);

repeat //color seems to beat reflection at this task
FindObjEx(x, y, ['ace', 'urn'], [2702428, 2768223], 5, 50, 0, 0, 515, 337);
if (Options[CurrentPlayer].Ore = SteelBarID) then
MouseItem(3, True);
if (clickchoice = 3) then
begin
Mouse (x, y, 3, 3, false);
Wait(400+random(125));
if (Options[CurrentPlayer].Ore = SteelBarID) then
R_ChooseOption ('Use Steel')
else
R_ChooseOption ('Smelt Furnace');
end else
Mouse (x, y, 3, 3, true);
Wait(1500+random(500));
Inc(i);
until SmeltingScreen or (i >= 4);

{$IFDEF REFLECTION}
if (i >= 4) then
TP := TileToMS (Tile(3110, 3502), 0);
repeat
Mouse (TP.x, TP.y, 3, 3, false);
Wait(300+random(150));
if (Options[CurrentPlayer].Ore = SteelBarID) then
R_ChooseOption ('Use Steel')
else
R_ChooseOption ('Smelt Furnace');
Wait(700+random(175));
Inc(j);
until SmeltingScreen or (j >= 3);
{$ENDIF}

if SmeltingScreen then
Writeln('Found smelting screen');

if (j >= 3) then
begin
Writeln('Could not find the smelting menu, switching players');
ProgressReport;
NextPlayer(false);
end;

repeat
clickchoice := Random(4);
if not (clickchoice = 3) then
if (Options[CurrentPlayer].Bar = SteelBarID) then
MouseBox(269, 400, 310, 450, 1)
else
MouseBox(238, 400, 280, 446, 1);
if (clickchoice = 3) then
begin
if (Options[CurrentPlayer].Bar = SteelBarID) then
MouseBox(269, 400, 310, 450, 3)
else
MouseBox(238, 400, 280, 446, 3);
ChooseOption ('Make All');
end;
Wait(500+Random(300));
until FindChatBoxText('You place', 8, clBlack) or
FindChatBoxText('The molten', 8, clBlack) or (GetAnimation = 899)
or (GetAnimation = 3243);

MarkTime(timeout);
repeat
Antiban;
DoChecks;
if LevelUp then
begin
stats_IncVariable('Total Levels Gained', 1);
Smelt;
end;
Wait(300+random(500));
until not R_ItemExists(Options[CurrentPlayer].Ore, Item)
or (timeout-GetSystemtime > 180000);

Wait(200+random(200));
LoadCalculator;
end;

procedure IsBreakTime; //modified from Travs Ess Miner
var
T:Integer;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

if (Options[CurrentPlayer].Break = 0) then Exit;
if R_BankScreen then CloseBank;
if(GetSystemTime-BreakTime >= Options[CurrentPlayer].Break) then
begin
Writeln('Going to break');
T := GetSystemTime+RandomRange(1200000,2400000);
begin
ExitToLobby;
repeat
Writeln('Time Left in Break:' + MsToTime((T-GetSystemTime),Time_Short));
if(T - GetSystemTime>60000) then
begin
Wait(RandomRange(180000,300000));
end
else
begin
Wait(RandomRange(40000,60000));
end;
until(T<GetSystemTime);
Writeln('Going back to smelting.');
if (LobbyScreen) then
begin
MouseBox(72, 445, 570, 477, 1);
end
else
begin
LoginPlayer;
end;
end;
end;
repeat
BreakTime:=GetSystemTime;
Wait(1000+random(1000));
until(Loggedin);
end;

procedure TheBank;
var
i, j, Tab : integer;
ItemCheck: TBankItem;
Item:TInvItem;
begin
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then
Exit;

Wait(200+Random(500));
if not R_OpenBankBooth(Bank_EV) or not OpenBank(Bank_EV, False, False) then
begin
Writeln('Could not find the bank, switching players');
ProgressReport;
NextPlayer(false);
Exit;
end;

if R_PinScreen or PinScreen then
if Players[CurrentPlayer].Pin = '' then
begin
Writeln('Please give the script a pin to use for this character');
ProgressReport;
NextPlayer(false);
Exit;
end else
begin
i := 0;
Writeln('Entering pin');
repeat
Wait(600+random(500));
InPin(Players[CurrentPlayer].Pin);
Inc(i);
until (i >= 3) or R_BankScreen or BankScreen;

if (i >= 3) then
begin
Writeln('Could not enter the pin correctly, switching players');
ProgressReport;
NextPlayer(false);
Exit;
end;
end;

if R_DepositAllBy(Options[CurrentPlayer].Bar) then
Wait(500+Random(300));
if (InvCount > 0) and not (Options[CurrentPlayer].Bar = CBallID) then
DepositAll;
if (Options[CurrentPlayer].Bar = CBallID) and (InvCount > 1) then
Deposit(2, 28, True);
IsBreakTime;

if not R_ItemExistsInBank(Options[CurrentPlayer].Ore, ItemCheck) then
begin
Writeln('Out of the primary ore, switching players');
CloseBank;
ProgressReport;
NextPlayer(false);
Exit;
end;

repeat
if (CurrentOre = 0) then
begin
if not R_ItemExists(CBallMouldID, Item)
and (Options[CurrentPlayer].Ore = SteelBarID) then
R_WithdrawItemEx(CBallMouldID, 1, Tab, true);

case Options[CurrentPlayer].Bar of
BronzeBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore, 14, Tab, true);
IronBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore, 28, Tab, true);
SteelBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore, 9, Tab, true);
CBallID: R_WithdrawItemEx(Options[CurrentPlayer].Ore, 27, Tab, true);
MithrilBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore, 5, Tab, true);
AdamantineBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore, 4, Tab, true);
RuniteBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore, 3, Tab, true);
SilverBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore, 28, Tab, true);
GoldBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore, 28, Tab, true);
end;
CurrentOre := 0;
if not (Options[CurrentPlayer].Ore2 = 0) and (InvCount < 15) then
CurrentOre := 1;
end;

if not (Options[CurrentPlayer].Ore2 = 0) and (CurrentOre = 1) then
begin
case Options[CurrentPlayer].Bar of
BronzeBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore2, 14, Tab, true);
SteelBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore2, 18, Tab, true);
MithrilBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore2, 20, Tab, true);
AdamantineBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore2, 24, Tab, true);
RuniteBarID: R_WithdrawItemEx(Options[CurrentPlayer].Ore2, 24, Tab, true);
end;
if (InvCount > 24) then
CurrentOre := 1
else
CurrentOre := 0;
end;
Wait(300+Random(200));
Inc(j);
until (j >= 3) or (InvCount > 24);

if (j >= 3) then
begin

if (InvCount < 14) then
begin
Writeln('Don''t have enough ore, switching players');
CloseBank;
ProgressReport;
NextPlayer(false);
Exit;
end;

Writeln('Couldn''t find any ore, switching players');
CloseBank;
ProgressReport;
NextPlayer(false);
Exit;
end;
Wait(750+random(500));
end;

procedure StatsCommit;
begin
if (StatsUser = '') then
Exit;

case Options[PlayerNumber].Bar of
BronzeBarID: stats_IncVariable('Bronze Bars Smithed', Options[PlayerNumber].TotalBars);
IronBarID: stats_IncVariable('Iron Bars Smithed', Options[PlayerNumber].TotalBars);
SteelBarID: stats_IncVariable('Steel Bars Smithed', Options[PlayerNumber].TotalBars);
MithrilBarID: stats_IncVariable('Mithril Bars Smithed', Options[PlayerNumber].TotalBars);
AdamantineBarID: stats_IncVariable('Adamant Bars Smithed', Options[PlayerNumber].TotalBars);
RuniteBarID: stats_IncVariable('Runite Bars Smithed', Options[PlayerNumber].TotalBars);
CBallID: stats_IncVariable('Cannonballs (Made)', Options[PlayerNumber].TotalBars);
end;
stats_IncVariable('Loads Done', Options[PlayerNumber].CompletedLoads);
stats_IncVariable('Total EXP Gained', Options[PlayerNumber].TotalXP);

if Stats_Commit then
Writeln('Stats successfully uploaded')
else
Writeln('Stats failed to upload');
end;

procedure Startup;
begin
Smart_Server := 29;
Smart_Members := True;
Smart_Signed := True;
Smart_SuperDetail := False;
ActivateClient;
TimeMark := 0;
PlayerNumber := 0;
CurrentOre := 0;
if not (StatsUser = '') then
SetupSRLStats(38, ToStr(StatsUser), ToStr(StatsPass));

ClearDebug;
SetupSRL;
SetupReflection;
DeclarePlayers;
LoginPlayer;
BreakTime := GetSystemTime;
end;

procedure Mainloop;
begin
repeat
Wait(1000+random(300));
Options[CurrentPlayer].Ore2 := 0;
OrePicker;
Options[CurrentPlayer].StartXP := GetXP(skill_Smithing)
XPCalculator;
repeat
if not (LoggedIn) or not (Players[CurrentPlayer].Active) then Exit;
DoChecks;
TheBank;
BanktoFurnace;
LocateFurnace;
Smelt;
FurnacetoBank;
until(Not LoggedIn);
if not (StatsUser = '') then
begin
Writeln('Attempting to upload progress report for last player');
StatsCommit;
end;
Wait(3000+random(1000));
Inc(PlayerNumber);
if not (PlayerNumber > HowManyPlayers - 1) then
NextPlayer(Players[PlayerNumber].Active);
until(AllPlayersInactive);
FreeSRL;
TerminateScript;
end;

begin
Startup;
Mainloop;
end.

ReadySteadyGo

2011-02-18 00:24:10

Really nice script mate. Very thoroughly thought out and good logic. It's a yes from me.

Rich

2011-02-18 03:05:48

I want your name in yellow. Yes.

There are some problems with the script, but only little things which can easily be fixed. You also have a good attitude.

Frement

2011-02-18 04:57:04

Script is good, attitude (as far as I have seen) is good, yes from me.

cycrosism

2011-02-18 07:06:36

Voted no due to reflection

Dynamite

2011-02-18 07:24:36

Yes from me.
[offtopic] cycrosism his ref script shows a lot more knowledge than your scripts. [/offtopic]

cycrosism

2011-02-18 07:38:38

Your point being? I am not applying for SRL members so don't compare a script I made (without scripting for 2+ years) to someone who has just made a script and gotten a lot of help from the community.

Actually his script doesn't show much knowledge. I don't see radialwalking, bitmaps, DTMs, DDTM's or custom TPA's. I see reflection for almost everything and FindObjEx.

3Garrett3

2011-02-18 07:56:49

I'm leaning toward no, because here is what I see when I look through the code:

Lots of things are "Modified versions from X" which to me means that the base code for that function isn't yours. I also see a lot of what I would call lazyness in your efforts. Making a simple TPA function to find the bank or the furnace would have pushed me to a yes, but all I see is SRL's FindObject and Reflection bank opening. You could have even made a custom reflection bank opener, something that finds the IDs and sorts based on distance, then clicks the closest one, with a couple failsafes and maybe the reflection or SRL function at the end.

You seem to use this "IfDef Reflection" in many cases, yet there isn't really a point to much of it. The user (as of now) has to define it because you have a few functions that wouldn't work without reflection, so the whole point of this "Colour backup" that you have now is pretty useless in the case of the end user.

Lastly, your locate furnace function is pretty sloppy. You have a check for the ID but don't even use any reflection to find the thing, unless I'm misunderstanding "GetInteractableAt", I didn't think that it clicked things. If it did, it would be an example of having some lazy coding, make a custom function, show us what you've got ;).

tldr;
I would like to vote yes, because I think you have a lot of potential, but you have to fix a few things in the script before hand, or explain a couple things to me at least. I'm holding my vote.

Rich

2011-02-18 10:33:04

From: cycrosism
Voted no due to reflection

As soon as I saw 8-1 at the top when I opened the thread, I knew the 1 would be you. Just sayin'.

IPwnz

2011-02-18 10:56:29

From: 3Garrett3
Lots of things are "Modified versions from X" which to me means that the base code for that function isn't yours. I also see a lot of what I would call lazyness in your efforts. Making a simple TPA function to find the bank or the furnace would have pushed me to a yes, but all I see is SRL's FindObject and Reflection bank opening. You could have even made a custom reflection bank opener, something that finds the IDs and sorts based on distance, then clicks the closest one, with a couple failsafes and maybe the reflection or SRL function at the end.


I know I used modified functions for a couple things (DoChecks and Antiban), but I only used other functions that, while I could have made them myself, would have likely been very similar anyway. That said, I could've written my own functions, and I apologize.

From: 3Garrett3
You seem to use this "IfDef Reflection" in many cases, yet there isn't really a point to much of it. The user (as of now) has to define it because you have a few functions that wouldn't work without reflection, so the whole point of this "Colour backup" that you have now is pretty useless in the case of the end user.


I planned on going through and making the script work entirely without Reflection, but I began to run into a lot of little problems (I couldn't get CountItemsIn to work to replace R_ItemExists, my ore and bar bitmap finding functions didn't do their jobs, etc). In the end I should've just taken that out, but I wanted to show that I should be able to have reflection and color coexist in future scripts, even if it didn't work out here/

From: 3Garrett3
Lastly, your locate furnace function is pretty sloppy. You have a check for the ID but don't even use any reflection to find the thing, unless I'm misunderstanding "GetInteractableAt", I didn't think that it clicked things. If it did, it would be an example of having some lazy coding, make a custom function, show us what you've got ;).


That furnace finder is one of the more failsafed pieces of the script. The whole idea of the procedure "FindFurnace" is just to confirm that the walking from the bank was successful before it tries to click the furnace and continue on. The GetInteractableAt is the easiest Reflection check, since if the ID of that tile (which could only be grabbed if it can see the tile) matches up with what I know the ID is, then we've found it, case closed. Otherwise it runs through a series of checks to make sure it is in the right room.

From: 3Garrett3
tldr;
I would like to vote yes, because I think you have a lot of potential, but you have to fix a few things in the script before hand, or explain a couple things to me at least. I'm holding my vote.


I hope I answered everything you were asking for, and thank you for taking the time to ask, it means a lot. :)

Cazax

2011-02-18 10:56:46

No. Lack of failsafes and pretty much what Garrett's said.
Path := Tile(3109, 3502);
WalktoTile(Path, 1, 1);
{$ELSE}
if not (Walk(16777215, 23, Point(675, 84))) then
Walk(5922400, 23, Point(676, 63));
{$ENDIF}
FFlag(5);
There you're assuming it successfully walked to the furnace, no If Not WalkToTile Then or If Not Walk() Then. Same for FurnaceToBank.

if not Furnace.ID = FurnaceID then
begin
if not FindObjEx(x, y, ['ace', 'urn'], [2702428, 2768223], 5, 50, 0, 0, 515, 337) then
Writeln('Furnace is missing, checking to see if we are in the right area');
if not InSmelter then
begin
writeln('Not in the right room, attempting to walk to it');
DoChecks;
BanktoFurnace;
if not InSmelter then
begin
Writeln('Time to give up, cannot find the furnace');
ProgressReport;
NextPlayer(false);
Exit;
end;
end else
Writeln('All better now, found the furnace');
end;
You did wrong on the logic. Let's say you're in the smelter but can't find the Furnace. The script will say 'Furnace is missing, checking to see if we are in the right area' and then 'All better now, found the furnace'.

In Smelt():

FindObjEx(x, y, ['ace', 'urn'], [2702428, 2768223], 5, 50, 0, 0, 515, 337);
No failsafe here! That's not a good practice.

3Garrett3

2011-02-18 11:23:17

From: IPwnz
I know I used modified functions for a couple things (DoChecks and Antiban), but I only used other functions that, while I could have made them myself, would have likely been very similar anyway. That said, I could've written my own functions, and I apologize.



I planned on going through and making the script work entirely without Reflection, but I began to run into a lot of little problems (I couldn't get CountItemsIn to work to replace R_ItemExists, my ore and bar bitmap finding functions didn't do their jobs, etc). In the end I should've just taken that out, but I wanted to show that I should be able to have reflection and color coexist in future scripts, even if it didn't work out here/



That furnace finder is one of the more failsafed pieces of the script. The whole idea of the procedure "FindFurnace" is just to confirm that the walking from the bank was successful before it tries to click the furnace and continue on. The GetInteractableAt is the easiest Reflection check, since if the ID of that tile (which could only be grabbed if it can see the tile) matches up with what I know the ID is, then we've found it, case closed. Otherwise it runs through a series of checks to make sure it is in the right room.



I hope I answered everything you were asking for, and thank you for taking the time to ask, it means a lot. :)


So I'm still pretty unsure about the script, but I like your attitude and I'm going off my gut feeling that you will learn more once you get into members, I'm voting yes.

IPwnz

2011-02-18 11:24:52

From: Cazax
No. Lack of failsafes and pretty much what Garrett's said.
Path := Tile(3109, 3502);
WalktoTile(Path, 1, 1);
{$ELSE}
if not (Walk(16777215, 23, Point(675, 84))) then
Walk(5922400, 23, Point(676, 63));
{$ENDIF}
FFlag(5);
There you're assuming it successfully walked to the furnace, no If Not WalkToTile Then or If Not Walk() Then. Same for FurnaceToBank.


From what I'm reading of the walking procedures, they have separate reflection and color walkers. After it walks there (or not) then a separate procedure will start running checks to see if it was successful (FindFurnace specifically). I see now that it would be a good idea to add in a failsafe during the walk itself; however, because this script only has to do one click to get the the furnace and back to the bank, the need for a failsafe during the walk is "almost" negligible. I certainly see how I need to add failsafes there though, so thanks for pointing it out.

From: Cazax

if not Furnace.ID = FurnaceID then
begin
if not FindObjEx(x, y, ['ace', 'urn'], [2702428, 2768223], 5, 50, 0, 0, 515, 337) then
Writeln('Furnace is missing, checking to see if we are in the right area');
if not InSmelter then
begin
writeln('Not in the right room, attempting to walk to it');
DoChecks;
BanktoFurnace;
if not InSmelter then
begin
Writeln('Time to give up, cannot find the furnace');
ProgressReport;
NextPlayer(false);
Exit;
end;
end else
Writeln('All better now, found the furnace');
end;
You did wrong on the logic. Let's say you're in the smelter but can't find the Furnace. The script will say 'Furnace is missing, checking to see if we are in the right area' and then 'All better now, found the furnace'.


I've modified it a bit, I imagine this would work out better:
if not Furnace.ID = FurnaceID then
begin
if not FindObjEx(x, y, ['ace', 'urn'], [2702428, 2768223], 5, 50, 0, 0, 515, 337)
and not InSmelter then
begin
writeln('Not in the right room, attempting to walk to it');
DoChecks;
BanktoFurnace;
if not InSmelter then
begin
Writeln('Time to give up, cannot find the furnace');
ProgressReport;
NextPlayer(false);
Exit;
end;
end else
Writeln('All better now, found the furnace');
end;

And I agree I could add more furnace finding failsafes into the code, but I've had absolutely no problem with it as-is.

From: Cazax
In Smelt():

FindObjEx(x, y, ['ace', 'urn'], [2702428, 2768223], 5, 50, 0, 0, 515, 337);
No failsafe here! That's not a good practice.


I operated under the assumption that if the script had already confirmed that the furnace existed then it should be able to complete that operation fine. Plus, if you look a little farther down, you'll see that if it fails clicking the furnace with FindObjEx then it will attempt do it with Reflection, so I think there's enough failsafe there.

Again, thanks for asking everything, it's really helps make a better script in the end. :)

pyroryan

2011-02-18 11:48:24


repeat
clickchoice := Random(4);
if not (clickchoice = 3) then
if (Options[CurrentPlayer].Bar = SteelBarID) then
MouseBox(269, 400, 310, 450, 1)
else
MouseBox(238, 400, 280, 446, 1);
if (clickchoice = 3) then
begin
if (Options[CurrentPlayer].Bar = SteelBarID) then
MouseBox(269, 400, 310, 450, 3)
else
MouseBox(238, 400, 280, 446, 3);
ChooseOption ('Make All');
end;
Wait(500+Random(300));
until FindChatBoxText('You place', 8, clBlack) or
FindChatBoxText('The molten', 8, clBlack) or (GetAnimation = 899)
or (GetAnimation = 3243);

And what if the position changes, etc.? There are no failsafes here. The rest of the logic seems good, so I can't complain too much.

IPwnz

2011-02-18 11:53:33

From: pyroryan

And what if the position changes, etc.? There are no failsafes here. The rest of the logic seems good, so I can't complain too much.


I feel the same way. However, SRL's smelting screen functions are all broken due to an update that happened awhile back, so I think I made a good, but obviously broken if they update again, smelting procedure overall.

Home

2011-02-18 12:29:01

Yes from me. I hope you get in :)


~Home

Blumblebee

2011-02-18 15:36:18

An easy yes. Although I'm not a fan of the whole modified by and credits to, the logic is nice and the lack of failsafes is due a bit to inexperience and moreso I think to reflection. Nonetheless, well done. Looking forward to what you can do.

Daniel

2011-02-18 18:53:43

Yes, due to your attitude. You have the willingness to improve and learn.

@cycrosism: You're a halfwit…

cycrosism

2011-02-18 19:07:54

From: Daniel
Yes, due to your attitude. You have the willingness to improve and learn.

@cycrosism: You're a halfwit…


When you apply for SRL members you are suppose to show knowledge about the SRL include. Reflection is a 3rd party include.

IPwnz

2011-02-18 19:12:02

From: cycrosism
When you apply for SRL members you are suppose to show knowledge about the SRL include. Reflection is a 3rd party include.


I certainly tried to use SRL, but in some cases (take smithing.scar) it just made more sense to use Reflection. Not to say I couldn't have used more SRL functions though, and I agree that I could've relied on SRL more than I did.

Daniel

2011-02-18 21:34:47

From: cycrosism
When you apply for SRL members you are suppose to show knowledge about the SRL include. Reflection is a 3rd party include.


And he does show knowledge of the SRL include. You just fail to read past the line that has {$i reflection/reflection.simba} due to your incredible ignorance.

Also, it's more than just displaying your scripting ability cycrosism ;) Get that in your head.

cycrosism

2011-02-18 21:44:30

From: Daniel
And he does show knowledge of the SRL include. You just fail to read past the line that has {$i reflection/reflection.simba} due to your incredible ignorance.

Also, it's more than just displaying your scripting ability cycrosism ;) Get that in your head.


Actually if you look at my second post in this thread you will realise your own ignorance.

Rich

2011-02-19 06:53:44

Honestly, I would argue with you cycrosism, but we've had this argument too many times in other apps and in other threads in Members.

Gu3st...

2011-02-19 07:58:24

From: cycrosism
Actually if you look at my second post in this thread you will realise your own ignorance.
Let me list you the SRL functions he uses:
[php]LoggedIn
GetXP
RandomRClick
PickUpMouse
RandomMovement
BoredHuman
ExamineInv
FindNormalRandoms
NextPlayer
MarkTime
MakeCompass
SetAngle
GetMMLevels
SetRun
Mouse
FFlag
FindObjEx
MouseItem
FindChatBoxText
stats_IncVariable
CloseBank
ExitToLobby
LobbyScreen
MouseBox
LoginPlayer
OpenBank
PinScreen
BankScreen
DepositAll
Deposit
Stats_Commit[/php]And you say he uses reflection for everything?
He certainly does know how to use arrays.. Players[].blah.. timing.. color & reflection searching..
There's a lot that he can improve on, sure, but voting no just because someone includes reflection is just idiotic.

IPwnz:
I'm sorry I didn't get to you before you applied :/
I see you do {$IFDEF Reflection} in a lot of places, and that' great! It shows that you know how to make scripts work with both color and reflection, but unfortunately you don't do it in every place that requires it. Remember, you have to do it in every place that you call a reflection procedure, function or variable. This means you have to do it in Startup, TheBank, Smelt (You do it in some places, but not all), LocateFurnace, InSmelter, and some more too.
Am I right in the suspicion that this was originally a 100% reflection script? By the looks of it, this script wouldn't compile without reflection included. And if you got it to compile, it wouldn't work properly because of the OptionsRecord being based on reflection IDs and such.

I love that you know how to use custom types/record (OptionsRecord), but in this case it's not necessary because SRL has players.integers / players.strings / players.booleans and players.extendeds that should suit all your needs.

You have to do tasks to get access to the furnace, but you never check if the player has actually done them. This applies to levels too. You have the user set the bars they want to make, but you never check if the player actually can smith/smelt it.

I'm sorry, but this is a no from me

pyroryan

2011-02-19 11:21:47

From: Zyt3x
Let me list you the SRL functions he uses:
You have to do tasks to get access to the furnace, but you never check if the player has actually done them. This applies to levels too. You have the user set the bars they want to make, but you never check if the player actually can smith/smelt it.


Thank god I'm not the only one that complained about failsafes. I didn't see the rest of the flaws in my few minute analysis. So thanks :P
I'm holding still.

IPwnz

2011-02-19 11:43:53

From: Zyt3x
I'm sorry I didn't get to you before you applied :/
I see you do {$IFDEF Reflection} in a lot of places, and that' great! It shows that you know how to make scripts work with both color and reflection, but unfortunately you don't do it in every place that requires it. Remember, you have to do it in every place that you call a reflection procedure, function or variable. This means you have to do it in Startup, TheBank, Smelt (You do it in some places, but not all), LocateFurnace, InSmelter, and some more too.
Am I right in the suspicion that this was originally a 100% reflection script? By the looks of it, this script wouldn't compile without reflection included. And if you got it to compile, it wouldn't work properly because of the OptionsRecord being based on reflection IDs and such.


From the get-go I had in mind that I would make the script work, whether that was with Reflection or SRL functions, but it ended up that a good portion of what I needed to do was easily accomplished with Reflection, so yes, it was essentially a 100% reflection script to start with.

From: Zyt3x
I love that you know how to use custom types/record (OptionsRecord), but in this case it's not necessary because SRL has players.integers / players.strings / players.booleans and players.extendeds that should suit all your needs.


Completely true, my only reason for doing it with an Options record was to give the variables names that I could remember as I was coding, since Booleans[2] has no meaning in its name alone.

From: Zyt3x
You have to do tasks to get access to the furnace, but you never check if the player has actually done them. This applies to levels too. You have the user set the bars they want to make, but you never check if the player actually can smith/smelt it.


I thought about including those types of failsafes (and honestly I should've including a level check for the bar type), but I believed that the "esotericness" of the script would mean that anyone who was willing to try it out would have the requirements completed. But of course, it's always best to pretend that you're dealing with idiots when scripting, so I see now that I should've added those failsafes in.

Thank you for the great reply Zyt3x, even if it was a little late. ;)

Bad Boy JH

2011-02-19 22:19:26

From: IPwnz

Completely true, my only reason for doing it with an Options record was to give the variables names that I could remember as I was coding, since Booleans[2] has no meaning in its name alone.


I use a constant instead of the 2 in there so its…

Players[CurrentPlayer].Integers[LoadsDone]
or
Players[CurrentPlayer].Booleans[UseRing]

IPwnz

2011-02-19 22:41:57

From: Bad Boy JH
I use a constant instead of the 2 in there so its…

Players[CurrentPlayer].Integers[LoadsDone]
or
Players[CurrentPlayer].Booleans[UseRing]


I hadn't thought of that, thank you for the idea. :)

Wizzup?

2011-03-03 05:36:21

You should really indent the if statements if you nest them. Could do with additional failsafes.

Welcome!