SRL Archive - Archive

Kaede666 - SRL Member Application


Kaede666

2009-07-26 00:15:06

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


Are you affilated in anyway with Jagex LTD?
No

Were you Referred to SRL?



What is your general programming knowledge?
Scar
C++
C
C#
Java - only a little
Javascript
VB
COBAL
.Net


Are you a member of any other communities?
No


Tell us about yourself…
From: Kaede666
I'm William, from Canada!
I enjoy talking with friends, and programming.
(I haven't been on for a while because I had a major project, but I'm done now)



Please show us one (or multiple) of your scripts.
rogram Kaede666_Cutter;
{.include SRL/SRL/misc/SMART.scar}
{.include SRL/SRL.scar}
{.include SRL/SRL/Skill/WoodCutting.scar}
var
x, y, i, TreeWait, LogDTM, TinderDTM: integer;
TreeTxT: array of string;
TreeColors: array [0..3] of integer;

procedure DeclarePlayers;
begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;
Players[0].Name := '';
Players[0].Pass := '';
Players[0].Nick := '';
Players[0].Active:= True;
Players[0].Strings[0] := ''; // normal, oak, willow, maple or yew
end;

procedure SetupVars;
begin
TinderDTM := DTMFromString('78DA63B4626060F8C48002DC6C39C0342394C' +
'F6809249E33A0014654354E40E22D01358E40E20F01350640E217' +
'01353A40E23D7E3500C7D1079A');
LogDTM := DTMFromString('78DA634C656060F8C880025AD3EDC1342394C' +
'F980B249E33A0014654359140E23701354540E2070135D140E215' +
'0135D984ED0200C28E0950');
case lowercase(Players[CurrentPlayer].Strings[0]) of
'normal' : begin
writeln('selected');
TreeColors[0] := 462348;
TreeColors[1] := 798246;
TreeColors[2] := 1125158;
TreeColors[3] := 3036236;
TreeTxT := ['Tree', 'Tre', 'ree'];
TreeWait := 1000;
end;
'oak' : begin
TreeColors[0] := 2584416;
TreeColors[1] := 3305828;
TreeColors[2] := 4162678;
TreeColors[3] := 5544845;
TreeTxT := ['Oak', 'Oa', 'ak'];
TreeWait := 2000;
end;
'willow' : begin
TreeColors[0] := 2181686;
TreeColors[1] := 6193521;
TreeColors[2] := 3755332;
TreeColors[3] := 3234376;
TreeTxT := ['Willow', 'Will', 'illo', 'llow'];
TreeWait := 3000;
end;
'maple' : begin
TreeColors[0] := 1319487;
TreeColors[1] := 725796;
TreeColors[2] := 2177124;
TreeColors[3] := 1385537;
TreeTxT := ['Maple', 'Map', 'apl', 'ple'];
TreeWait := 3500;
end;
'yew' : begin
TreeColors[0] := 3241318;
TreeColors[1] := 2119755;
TreeColors[2] := 2645844;
TreeColors[3] := 3240035;
TreeTxT := ['Yew', 'Ye', 'ew'];
TreeWait := 4500;
end;
end;
end;

procedure Lightcheck;
var Z: integer;
begin
MarkTime(Z);
Repeat
wait(10);
Until (TimeFromMark(Z) > 3000); //Can't Figure out what the best way to know when it is lit
end;

procedure Burn;
var tx, ty, lx, ly : integer;
begin; // Thanks to 99_
if(FindDTM(TinderDTM, tx, ty, MIX1, MIY1, MIX2, MIY2) and
FindDTM(LogDTM, lx, ly, MIX1, MIY1, MIX2, MIY2))then
repeat
Mouse(tx, ty, 2, 2, True);
Wait(RandomRange(250, 500));
Mouse(lx, ly, 2, 2, True);
Wait(RandomRange(1000, 3000));//I've been trying to think of a better way to do this with color.. I'll get back to you on it ;)
until(not(FindDTM(LogDTM, lx, ly, MIX1, MIY1, MIX2, MIY2)));
end; // End of Thanks =P

Procedure Antiban;
begin
if not LoggedIn then Exit;
case Random(22) of
0:RandomRClick;
1:HoverSkill('woodcutting',False);
2:BoredHuman;
3:RandomMovement;
4:PickUpMouse;
6:HoverSkill('firemaking', false);
end;
end;

procedure TreeTime;
var Failed: integer;
begin
if (not LoggedIn) then Exit;
for i := 0 to 3 do
begin
if FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT) then
repeat
FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)
Wait(100 + Random(300));
MMouse(x, y, 2, 2);
begin
Wait(200 + Random(400));
case Random(2) of
0: begin
Mouse(x, y, 4, 4, False);
Wait(250 + Random(200));
ChooseOption('hop');
end;
1: begin
Mouse(x, y, 4, 4, True);
end;
end;
Wait(TreeWait + Random(200));
FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)
MMouse(x, y, 2, 2);
AntiBan;
if not (LoggedIn) then
NextPlayer(False);
LoginPlayer;
end;
until Invfull or not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT);
while (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)) do
repeat
MakeCompass('N');
Wait(300 + Random(300));
if (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)) then
MakeCompass('E');
Wait(300 + Random(300));
MakeCompass('S');
Wait(300 + Random(300));
MakeCompass('W');
Wait(300 + Random(300));
Inc(Failed);
until FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT) or (Failed = 5);
if (Failed = 5) then
begin
WriteLn('Tree Finding Failed :(');
NextPlayer(False);
end;
end;
end;
end;

begin
SetUpSRL;
SMARTSetUpEX(1, False, True, False);
SetTargetDC(SMARTGetDC);
ActivateClient;
ClearDebug;
setupvars;
declareplayers;
loginplayer;
Wait(500 + Random(300));
if(not(loggedin)) then
repeat
loginplayer;
wait(random(600));
until(loggedin);
MakeCompass('S');
SetAngle(True);
repeat;
TreeTime;
case Random(5) of
2:Antiban;
end;
if (invfull) then Burn;
Wait(100 + Random(300));
until(false);
end.

mormonman

2009-07-26 00:19:53

Script is well coded, but it just seems like its incredibly simple =\…. so its a no from me right now. Go make a script with some walking/banking, and if its as well coded, it might be a yes.

D1zl3

2009-07-26 00:22:33

shit thats actually really good for a first script :O
your standards are really good, and you show that you can use DTM's.
I say yes :D

JPHamlett

2009-07-26 00:54:13

its a no for me sorry try and use TPAs and add some walking and banking then u would have a yes from me

JAD

2009-07-26 01:20:52

A few things:

Why do you need the variable WoodType if it is going to be the same thing as Strings[0]? Players[CurrentPlayer].Strings[0] should be able to replace WoodType just fine.

Really no need for an if(not(LoggedIn))then Exit; in SetupVars; especially right in the middle of the procedure.

Lightcheck could be just Wait(3000); because it just waits 10 until it has waited 3000. There is no randomness here either which is bad. Try like wait(3000+random(1000));. To find out if the log was actually lit, try adjusting the chats so that it only shows game stuff, and wait until "you have successfully made the fire" or whatever shows up in the chat box (I'm pretty sure a message does).

In Burn, this:


if(FindDTM(TinderDTM, tx, ty, MIX1, MIY1, MIX2, MIY2))then
begin
if(FindDTM(LogDTM, lx, ly, MIX1, MIY1, MIX2, MIY2))then
repeat
Mouse(tx, ty, 2, 2, True);
Wait(RandomRange(250, 500));
Mouse(lx, ly, 2, 2, True);
Wait(RandomRange(1000, 3000));//I've been trying to think of a better way to do this with color.. I'll get back to you on it ;)
until(not(FindDTM(LogDTM, lx, ly, MIX1, MIY1, MIX2, MIY2)));
end;

Could be reduced to:


if(FindDTM(TinderDTM, tx, ty, MIX1, MIY1, MIX2, MIY2))and
(FindDTM(LogDTM, lx, ly, MIX1, MIY1, MIX2, MIY2))then
repeat
Mouse(tx, ty, 2, 2, True);
Wait(RandomRange(250, 500));
Mouse(lx, ly, 2, 2, True);
Wait(RandomRange(1000, 3000));//I've been trying to think of a better way to do this with color.. I'll get back to you on it ;)
until(not(FindDTM(LogDTM, lx, ly, MIX1, MIY1, MIX2, MIY2)));


You really should have a marktime in Burn to make sure that it doesn't repeatedly keep clicking on the logs if it's in an impossible spot to burn. Also checking for the message "You cannot light a fire here!" and moving is probably going to be necessary.

Your TreeTime really looks like a mess and could probably be reduced in length about 50%. I'll edit this post later if I really feel like looking through that.

I do not see you switch players ever in this script and I don't think I saw many (if any) Random Event checks.



This is a great start and you are really close. Just keep tweaking this script, fixing and adding new stuff and you'll do great next time (If you don't get in here). Good luck!

~JAD

cycrosism

2009-07-26 05:04:22

No, it's too simple in my opinion

markuska815

2009-07-26 08:49:20

It's a nice script for your first time. However, like others have said its a bit too simple. But you're on the right track. So keep it up.

Coh3n

2009-07-26 18:17:52

It's a no from me right now, sorry. I'll explain what I like and what I don't like about your script.

Pros:
  • Your standards are good, much better than a lot of first scripts I see.
  • I like all your programming experience, A LOT more than me. :p

Cons:
  • You don't free your DTMs anywhere, which is a BIG mistake as it will hog your computers memory (I think).
  • Your script is only 189 lines, much to short for me to say yes. That's not a lot of space to show us everything you know about scripting.
  • You're missing some semicolons at the end of some lines.

Suggestions:
  • You should keep one letter vars, like below, local so the script doesn't get confused if you use the same variable throuhgout your script.
  • var
    x, y, i, TreeWait, LogDTM, TinderDTM: integer;
  • You should antiban once every 10 times the procedure is called, so change Random(22) to Random(70).
  • Line 177 - if you are going to do a Random wait, you should do:
  • Wait(100 + Random(500);
    Because otherwise it could wait 1ms. ;)
  • Add in more failsafes, TPAs, walking, etc.

Overall, for a first script it's very good, you did well. However, I don't think it's quite good enough for SRL Members. Mainly because it is too simple and short. I think you should learn some more advanced techniques and apply again in a few weeks. Good job. :)

Cheers.

Naum

2009-07-26 22:38:47

Okay,

1) Instead of this:

TreeColors[0] := 462348;
TreeColors[1] := 798246;
TreeColors[2] := 1125158;
TreeColors[3] := 3036236;

It would be much easier to do this:

TreeColors := [462348, 798246, 1125158, 3036236];


2)This:

1: begin
Mouse(x, y, 4, 4, True);
end;

Could be shortened to:

1: Mouse(x, y, 4, 4, True);


3)Begin needed!

if not (LoggedIn) then
NextPlayer(False);
LoginPlayer;

to:

if not (LoggedIn) then
Begin
NextPlayer(False);
LoginPlayer;
End;

This is because and if statement will only perform the next line after it, that why you need the begins and ends :).


4)Again :)

if (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)) then
MakeCompass('E');
Wait(300 + Random(300));
MakeCompass('S');
Wait(300 + Random(300));
MakeCompass('W');
Wait(300 + Random(300));
Inc(Failed);

to:

if (not FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT)) then
begin
MakeCompass('E');
Wait(300 + Random(300));
MakeCompass('S');
Wait(300 + Random(300));
MakeCompass('W');
Wait(300 + Random(300));
Inc(Failed);
end;


5) Instead of this:

    case Random(5) of
2:Antiban;
end;

do this, its simpler:

If Random(5) = 2 Then AntiBan;


Good work so far. Pretty good for a beginner. I won't vote, but take all the feedback in account :).

marpis

2009-07-26 23:12:23

I'd have to say No.
Not advanced enough. But you seem to be a fast learner, keep on writing an you'll be a member in a couple of months :)

It's not good to call FindObjTPA multiple times in a single function, because it makes the script mess up easily.

This function is not perfect either, but here's some ideas to improve your TreeTime procedure.
I also suggest you to make it a function that returns boolean.

PS. Read about TPAs!

procedure TreeTime;
var
Failed: integer;
begin
if (not LoggedIn) then Exit;
for i := 0 to 3 do
repeat
if FindObjTPA(x, y, TreeColors[i], 30, 2, 15, 25, 10, TreeTxT) then
begin
GetMousePos(x, y); // FindObjTPA already hovers the tree
case Random(2) of
0: begin
Mouse(x, y, 0, 0, False);
WaitOption('hop', 500);
end;
1:Mouse(x, y, 0, 0, True);
end;
Wait(TreeWait + Random(200));
AntiBan;
end else
begin
Inc(Failed);
if (Failed mod 2 = 0) then Break; // Try to find the tree 2 times with
MakeCompass(Random(360)); // each color
wait(300+random(50));
end;
until(Invfull);

if (Failed > 7) then
begin
writeln('Tree Finding Failed :(');
NextPlayer(false);
end;

end;

Sir R. M8gic1an

2009-07-27 14:00:58

added your script rather than a link.

~RM

Sir R. M8gic1an

2009-08-08 17:13:14

I am sorry, but it seems like you won't make it this time. You are on the right track, keep improving and use the advice you have here received. Feel free to apply again in a month.

~RM