SRL Archive - Reflection Development

Reflection 2 Beta!


Drakan

2011-07-04 21:37:29

Since I am leaving for about a month on a trip, I will be releasing Reflection 2 as a beta today! I have done my part and worked very hard on this include, now I need your help. I need people to use the include, test it out, find memory leaks, submit bug fixes, and get this thing rollin' along! This needs to be a community effort from here on out. Until everything gets stable, we will not be merging it with the main branch for Reflection 1.

The include is in full working state but is missing a good number of random solvers. It has detectors for every single random, but if it doesn't have a solver then the character is disabled and logged out. This is a PERFECT opportunity for you to increase your scripting skills by creating solvers for those randoms, or porting working ones from other bots! (preferably TriBot).

So I need your help to test everything out! There have been a huge number of changes, bug fixes, speed increases, utility addition, and a change to how certain things work. Feel free to go through the include and start making those scripts! The more scripts that are made, the more it can be tested, and the easier it will be to get this in a more stable state. If anything it already is more stable than Reflection 1, but may have some random quirks that I haven't found yet.

I want to thank everyone for their efforts and patience while I've been workin on this. And a special thanks to pyroryan for being so diligent with the hooks. I want to thank benland, lordsaturn, mormonman, and others for ideas and for developing large numbers of important base functions. I would also like to extend a thanks to whacko999, Bixby Sayz, mat_de_b, and others for continually feeding me random accounts to work on. If I forgot you let me know, it's been a long day. Keep up the good work SRL and lets finish this job so we can grow our community and take over the botting scene! We might be limited with our programming language, but we have achieved a competitive state with this include. Thank you all!

The include can be found at this repository: Reflection 2

^Maybe someone can make some tuts for people to get that? :D.

Smarter Child

2011-07-04 21:38:36

First post!! <333333
E- What are the main differences from this and Reflection 1?

Flight

2011-07-04 21:43:58

Thank you Drags for finally releasing this beast! You've worked very hard on this and I think I speak for everyone when I say all your effort is greatly appreciated! I'm really excited to give this a try. :)

Drakan

2011-07-04 21:44:16

A lot. Go through it and find out :) Everything is cleaner, faster, and a lot of things such as GroundItems and Objects have new functionality to them. It's something you will have to just go through as there are too many changes for me to sit here and write out.

Edit: Thanks flight. Be sure to test it and try to find any bugs!

Flight

2011-07-04 21:51:00

Absolutely will do. I'll start moving everything over to my Simba right now and just explore the new Reflection, I'm excited. :D

By the way, it's funny, I released my AIO Jeweler literally 2 minutes after you posted this thread. :p

Tickyy

2011-07-04 22:21:52

Yay! Gonna check this out pretty soon :D!

Brandon

2011-07-04 22:38:33

function R_GetMidTile(Tile1, Tile2: TTile): TTile;

Returns the midway point of the 2 given tiles.

Does that let me click the line that's directly in the middle of two tiles touching?

or what about 4 tiles.. Like a farming patch and u wanna click right dead center which is where the herbs were.. or is model clicking gunna do that?

Edit: was also wondering if we can now detect if a familiar is summoned cuz they all have the same ID's to me so u can't really tell which one is yours if someone's is right next to yours. Or maybe u use interfaces for that :S

Edit 2: Never mind looked at the include.. doesn't have those.. Asked too much lol

Harry

2011-07-04 22:57:28

Was the invalid JNI error fixed? Was the main issue I had when testing… looks great, have fun on your trip.

Flight

2011-07-04 23:15:11

From: ggzz

Edit: was also wondering if we can now detect if a familiar is summoned cuz they all have the same ID's to me so u can't really tell which one is yours if someone's is right next to yours. Or maybe u use interfaces for that :S


I can help you with that.

Edit: It's not finding the RefCalculationsLib plugin, any ideas?

Yago

2011-07-04 23:53:23

Finally… Good job Drags… Enjoy your break.

Dgby714

2011-07-04 23:57:13

From: Flight
I can help you with that.

Edit: It's not finding the RefCalculationsLib plugin, any ideas?


If you pulled the git, its in your plugins folder, you gotta copy it over. https://github.com/Drags111/Reflection_Dev/tree/master/plugins

Flight

2011-07-05 02:06:59

From: Dgby714
If you pulled the git, its in your plugins folder, you gotta copy it over. https://github.com/Drags111/Reflection_Dev/tree/master/plugins


Yep I have it in the plugins folder, it's just not being found. :/

TRiLeZ

2011-07-05 02:56:24

I'm glad to see you guys got this out there. Good job everyone! Let the new reflection scripts flourish. :)

masterBB

2011-07-05 04:39:55

Great will finally update my interfacegrabber for the last time.

Also, this version doesn't work.

In this file you include lib/misc/simba.misc
https://github.com/Drags111/Reflection_Dev/blob/master/Reflection.simba

and in that folder there is so not such a file.
https://github.com/Drags111/Reflection_Dev/tree/master/lib/misc

also no lib/antirandoms… do I have the wrong git?

https://github.com/Drags111/Reflection_Dev/commit/796564af010ddbb67a8028c767bd7c4ab0057e3e ?

BazzBarrett

2011-07-05 05:03:46

same with
{$i ./lib/antirandoms/Antirandoms.simba} 
the file and folder does not exist. but this looks amazing thank you :) im gonna start trying this out today it realy will add so much more power to reflection :D

**BANNED The Man

2011-07-05 05:22:00

Well I shall be working on this quite a bit I expect :)
Good to see it out.

-Boom

Jakkle

2011-07-05 06:39:19

Nice 1 drags good work bro, I will look through it properly at the weekend and get back with any bugs :) Have a grate time away to :)

**BANNED The Man

2011-07-05 06:48:19

Umm not to be a noob but where am I pulling this to? Includes folder?

-Boom

masterBB

2011-07-05 06:50:58

From: Dynamite
Umm not to be a noob but where am I pulling this to? Includes folder?

-Boom


yes in the map reflections.
So you got includes/reflection/reflection.simba

And don't forget to move the plugins.

Flight

2011-07-05 07:57:55

Yeah I can't find Misc.Simba either…

masterBB

2011-07-05 08:09:13

From: Flight
Yeah I can't find Misc.Simba either…


Nobody can, as posted in my post you will see the commit where it pulled reflection 2.1(3) to reflection 2. It removed lots of files. Just click on that link to download them manual.

Drakan

2011-07-05 08:13:53

Thats weird, when I merged the branch it didnt merge my latest commits, like they didn't exist. Sorry I'm terrible with GIT. Fixing now.

EDIT: Committed, everything should compile just fine now! And be sure to move the plugin from the Reflection/plugins to the Simba/plugins folder.

EDIT2: I am officially leaving for my trip. There's going to be very limited internet access for me, so hopefully everything will go smoothly with the include. People like nava2 and pyroryan will be able to help out in committing fixes and the likes. Thanks for all of your patience! I'll be checking up on this thread when I hit some wifi spots like mcdonalds :D

Flight

2011-07-05 08:57:33

From: drags111
Thats weird, when I merged the branch it didnt merge my latest commits, like they didn't exist. Sorry I'm terrible with GIT. Fixing now.

EDIT: Committed, everything should compile just fine now! And be sure to move the plugin from the Reflection/plugins to the Simba/plugins folder.

EDIT2: I am officially leaving for my trip. There's going to be very limited internet access for me, so hopefully everything will go smoothly with the include. People like nava2 and pyroryan will be able to help out in committing fixes and the likes. Thanks for all of your patience! I'll be checking up on this thread when I hit some wifi spots like mcdonalds :D


Hey have fun on your trip man!

I've been adding some things to a couple files like, for example, MyPlayer. I've added Levels/Experience and declared them in 'constants', ect… Maybe I'll pick up working with reflection. :)

Drakan

2011-07-05 08:58:59

Absolutely! Like I said, its not 100% complete and I appreciate the help!

Flight

2011-07-05 10:09:48

It's working great Drags! I converted my AIO Jeweler over to R2 my CPU went from 50% to 34% usage now. :) I see quite a few things I can work on as well. I've updated MyPlayer to handle levels and experience (works fine) and I'll be modifying the Bank some now as well.

If I were to post my work on Reflection 2, where would you suggest I do so?

Dgby714

2011-07-05 10:23:11

From: Flight
It's working great Drags! I converted my AIO Jeweler over to R2 my CPU went from 50% to 34% usage now. :) I see quite a few things I can work on as well. I've updated MyPlayer to handle levels and experience (works fine) and I'll be modifying the Bank some now as well.

If I were to post my work on Reflection 2, where would you suggest I do so?


He is already gone =), Tho I would suggest forking refl 2 on GitHub then sending a pull request with your changes. (This is how Simba works =P)

Flight

2011-07-05 10:31:13

New used it. :p I'm guessing there's a tutorial on how to do so. Maybe I'll look around, or if you already know a tutorial that would help me out I'm sure open to suggestions. :)

Dgby714

2011-07-05 10:34:33

http://help.github.com/

Read this ^, pay extra attention to "Fork a Repo" and "Send pull request"

It's a great idea to Branch your changes and keep your master clean, also split your changes, He prob doesn't wanna see 15 totally different things in one pull request.

Jakkle

2011-07-05 11:19:56

I get this

[Error] (484:3): Unknown identifier 'SetupReflection' at line 483
Compiling failed.

Has it changed ?

BTW I've changed everything else in the script, this is the only error I get.

masterBB

2011-07-05 12:01:32

There is no setup anymore… You can still call update hooks.

Jakkle

2011-07-05 12:27:06

Ok thanks

Jakkle

2011-07-05 13:09:43

I have sorted everything out, updated hooks and everything seemed to be ok. As it logs in the script attempts to look and see if the player has an axe equip.

As it does I get this,

[Reflection] The Inventory interface doesn't exist!

Either I have done something wrong lol or this needs fixing ? :)

Yago

2011-07-05 14:36:12

From: whacko999
I have sorted everything out, updated hooks and everything seemed to be ok. As it logs in the script attempts to look and see if the player has an axe equip.

As it does I get this,

[Reflection] The Inventory interface doesn't exist!

Either I have done something wrong lol or this needs fixing ? :)


I think the hooks were(or maybe are) down…

kingarabian

2011-07-05 14:48:24

I appreciate the work you've done on Reflection. Hopefully we can keep it stable. Hopefully ben can get around and improve SMART.

pyroryan

2011-07-05 15:39:14

From: whacko999
I have sorted everything out, updated hooks and everything seemed to be ok. As it logs in the script attempts to look and see if the player has an axe equip.

As it does I get this,

[Reflection] The Inventory interface doesn't exist!

Either I have done something wrong lol or this needs fixing ? :)


Going to check this out now. I'll edit the post after.

Edit:
Testing.
Edit2:
Committed.

BraK

2011-07-05 15:40:15

What drags111 you only have 1 rep square. :eek: Here let me help with more Rep+ Thanks for all your hard Work.

~BraK

Lancelot074

2011-07-05 15:49:33

From: whacko999
I have sorted everything out, updated hooks and everything seemed to be ok. As it logs in the script attempts to look and see if the player has an axe equip.

As it does I get this,

[Reflection] The Inventory interface doesn't exist!

Either I have done something wrong lol or this needs fixing ? :)


I also have this problem, thought it was just me.

pyroryan

2011-07-05 16:11:03

From: Lancelot074
I also have this problem, thought it was just me.


Inventory interface was changed. I already committed the fix to both reflection 1 and 2 (fix was tested in 1 because I had a script readily available for testing).

Lancelot074

2011-07-05 19:24:06

From: pyroryan
Inventory interface was changed. I already committed the fix to both reflection 1 and 2 (fix was tested in 1 because I had a script readily available for testing).


Even after updating, I'm still getting the same message. I made sure everything was up to date and I moved the plug-ins to the correct location.

Jakkle

2011-07-05 19:31:29

From: Lancelot074
Even after updating, I'm still getting the same message. I made sure everything was up to date and I moved the plug-ins to the correct location.


same here

pyroryan

2011-07-05 19:49:33

I'll have to test it in reflection 2 then. If someone with the issue could post the script, that'd be nice :).

Jakkle

2011-07-05 19:57:23

Just to check and see if I'm putting everything in the right place.
2 pics
Are these right ? and where do I put tools ? wasn't to sure on that 1.

masterBB

2011-07-05 19:59:43

From: whacko999
Just to check and see if I'm putting everything in the right place.
2 pics
img1
img2
Are these right ? and where do I put tools ? wasn't to sure on that 1.


You did it right, and tools may be placed anywhere you want. They are like scripts.

edit: You did put the files in the plugin folder there right? Not the plugin folder in the plugin folder ;). Of course you did, you are not an idiot, right?

pyroryan

2011-07-05 20:00:48

Looks fine. Could you post the script you were using?

Jakkle

2011-07-05 20:04:53

From: masterBB
You did it right, and tools may be placed everywhere you want. They are like scripts.


Gr8 thank :) happy to know I was right plus them pics might help other people.

I made 2 separate simba installs 1 with (ref 1) and 1 with (ref 2) and thought I got it wrong so I deleted it lol. I'm going to redo ref 2 now. Thanks once again masterBB for confirming :D


From: pyroryan
Looks fine. Could you post the script you were using?

I will redo it now and post

masterBB

2011-07-05 20:12:05

You could also create 2 folders, reflection and reflection2 in the include folder. Than at the top of every script you can select which one you want.

Jakkle

2011-07-05 20:24:44

From: pyroryan
Looks fine. Could you post the script you were using?


Script I'm using

{//////////////////////////////////////////////////////////////////////////
// Whacko999: G.E Oak Chopper and Banker V1.04 //
// //
// Requirements: //
// Lev 15 (or higher) to cut oaks trees. //
// Must start to the east of the east banker at G.E //
// Have any hatchet wilded or in inventory. //
// Latest Simba with latest SRL and Reflection. //
// Setup players you want in (DeclarePlayers) section //
// //
// Features: //
// Will chop Oak trees to the east of the G.E and bank at G.E. //
// Will do amount of loads you want. //
// You can set the time of when you want players to switch //
// to the next player thats active. //
// Has good anti ban and finds randoms. //
// SRL Stats. //
// //
// Thanks for using my script: //
// Please leave any feedback or problems in the forums //
// //
// A massive THANKS to Rogeruk for everything you have helped me with. //
// //
//////////////////////////////////////////////////////////////////////////}


Program GEOakCutterBanker;
{$define SMART}
{$i srl/srl.scar}
{$i srl/srl/misc/stats.simba}
{$i SRl/SRL/Skill/woodcutting.scar}
{$i Reflection/Reflection.simba}

Const
WITCH_WORLD = 11;
ARE_YOU_MEMBERS = FALSE;
SIGNED = TRUE;
DETAIL = FALSE;
SWITCH_EVERY = 0; // How many minutes to change player (Leave as 0 to disable)
// SRL Stats.
STATSUSERNAME = ''; // your stats username here
STATSPASSWORD = ''; // your stats password here

Var
TLevels, TBanked, TLogCount, Banked, LogCount,
LoadsToDo, Start, Every, WoodCuttingLevelStart, SwitchChar, Energy: Integer;
AxeIDs: TVariantArray;
AxeID : TIntegerArray;
SWITCH : Boolean;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

With Players[0] Do
Begin
Name := ''; //Your login name or email address.
Pass := ''; //Your players password.
Nick := ''; //3 letters of your on screen name Examp (Player123 = 'lay').
Active := TRUE; //Weather you want this player to be used or not (true = use).
Pin := ''; //Your players bank pin.
Integers[0] := 100; //How many TOTAL loads before setting false (Times Banked).
BoxRewards := ['amp']; //Reward you want from box after random.
Skill := 'woodcutting'; //Choose the xp you want from lamp.
End;

{ With Players[1] Do //To add players take away { << them, befor With and after End;
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Pin := '';
Integers[0] := 100;
BoxRewards := ['amp'];
Skill := 'woodcutting';
End; }

{ With Players[2] Do
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Pin := '';
Integers[0] := 100;
BoxRewards := ['amp'];
Skill := 'woodcutting';
End; }

End;

Function ToOakPath: TPointArray;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := [Point(3195, 3486), Point(3194, 3460)];
End;


Function ToGEPath: TPointArray;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := [Point(3195, 3486), Point(3167, 3489)];
End;

///////////////////////////////////////
// Thanks to Rich for this function. //
// R_WebWalkPath. //
///////////////////////////////////////
Function R_WebWalkPath(Points : TPointArray; WaitTime, RandWait : Integer) : Boolean;
Var
I : Integer;
Begin
Result := False;
For I := 0 To High(Points) Do
Begin
If (Not (R_WindWalk(Points[I]))) Then
Begin
WriteLn('Could not walk to point (' + IntToStr(Points[I].X) + ', ' + IntToStr(Points[I].Y) + ')');
Exit;
End;
Wait(WaitTime + Random(RandWait));
End;
Result:= True;
End;

Function ClickOakTree: Boolean;
Var
OakID: Integer;
OakTree: TRSObject;
MSPoint: TPoint;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := FALSE;
R_FindRandoms;
OakID := 1281;
OakTree := R_GetObject(OakID, 0, 15);
If (OakTree.ID > 0) Then
Begin
MSPoint := R_TileToMS(OakTree.Tile, 0);
Mouse(MSPoint.X, MSPoint.Y - 40, 6, 6, TRUE);
Result := TRUE;
End;
OakTree := NULL_RSOBJECT;
End;

Function FindOakTree: Boolean;
Var
OakID: Integer;
OakTree: TRSObject;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := FALSE;
R_FindRandoms;
OakID := 1281;
OakTree := R_GetObject(OakID, 0, 15);
If (OakTree.ID > 0) And (R_TileOnMS(OakTree.Tile, 0)) Then
Result := TRUE;
OakTree := NULL_RSOBJECT;
End;

Function HaveAxe:Boolean;
Var
TheItem : TInvItemArray;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := (R_ItemExistsEx(AxeIDs, TheItem))Or(InIntArray(AxeID, R_GetEquippedIDAt(3)));
End;

Function DoISwitchChar: Boolean;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := FALSE;
If (Banked >= LoadsToDo) Then
Begin
Writeln('Player has done all its loads!');
NextPlayer(FALSE);
Result := TRUE;
End;
If (SWITCH) Then
Begin
If (PlayersActive > 1) Then
Begin
If (TimeFromMark(Start) >= Every) Then
Begin
Writeln('Player has done its time!');
NextPlayer(TRUE);
Result := TRUE;
End;
End;
End;
End;

Function IsChopping: Boolean;
Var
Animations: TIntegerArray;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := FALSE;
Animations := [867, 869, 871, 873, 875, 877, 879];
If (InIntArray(Animations, R_GetAnimation)) Then
Result := TRUE;
End;

Procedure GoToOaks;
Begin
If (Not (LoggedIn)) Then
Exit;
If (FindOakTree) Then
Exit;
Writeln('Walking to the oak trees');
SetRun(TRUE);
R_WebWalkPath(ToOakPath, 2500, 1500);
R_MakeCompass('N');
SetAngle(True);
If (FindOakTree) Then
Begin
Writeln('Found Oak Trees');
End;
End;

Procedure GoToGE;
Begin
If (Not (LoggedIn)) Then
Exit;
Writeln('Invetory full going bank');
SetRun(TRUE);
R_WebWalkPath(ToGEPath, 2500, 1500);
R_MakeCompass('N');
SetAngle(True);
Writeln('At the bank');
End;

Procedure DoRandomMovement;
Var
Keys: TIntegerArray;
T: Integer;
Begin
If (Not (LoggedIn)) Then
Exit;
Keys := [VK_RIGHT, VK_LEFT];
T := Random(2);
If (Random(2) = T) Then
Begin
ActivateClient;
Wait(100 + Random(50));
KeyDown(Keys[T]);
Wait(500 + Random(1000));
KeyUp(Keys[T]);
Wait(500 + Random(1000));
SetAngle(true);
End Else If (Random(3) = 0) Then
SleepAndMoveMouse(1000 + Random(200));
End;

Procedure Antiban;
Begin
If (Not (LoggedIn)) Then
Exit;
Case Random(200) Of
150..155:
Begin
GameTab(RandomRange(tab_Combat, tab_Logout));
Wait(900 + Random(1000));
End;
110..115: PickUpMouse;
70..80: DoRandomMovement;
40..42: HoverSkill('Woodcutting', FALSE);
1..5: SleepAndMoveMouse(1000 + Random(500));
End;
End;

Procedure CutOakTree;
Var
Tries: Integer;
Begin
If (Not (LoggedIn)) Then
Exit;
R_FindRandoms;
Tries := 0;
If (ClickOakTree) Then
Begin
Writeln('Chopping Oak Tree');
Repeat
R_FindRandoms;
If (LevelUp) Then
Begin
Inc(TLevels);
Inc(Players[CurrentPlayer].Integers[2]);
stats_IncVariable('Total Levels Gained', 1);
End;
Wait(500 + Random(800));
Inc(Tries);
If (InvFull) Then
Exit;
Until (IsChopping) Or (Tries > 4);
While (IsChopping) Do
Begin
R_FindRandoms;
If (LevelUp) Then
Begin
Inc(TLevels);
Inc(Players[CurrentPlayer].Integers[2]);
stats_IncVariable('Total Levels Gained', 1);
End;
Wait(500 + Random(1000));
Antiban;
If (LevelUp) Then
Begin
Inc(TLevels);
Inc(Players[CurrentPlayer].Integers[2]);
stats_IncVariable('Total Levels Gained', 1);
End;
If (InvFull) Then
Exit;
End;
End;
Wait(300 + Random(300));
If (Not InvFull) Then
CutOakTree;
End;

Procedure BankGE;
Var
KeepIDs: TVariantArray;
ID: Integer;
NPC: TNPC;
NPC_Tile: TPoint;
Tries: Integer;
Begin
If (Not (LoggedIn)) Then
Exit;
Status('About to bank');
Tries := 0;
KeepIDs := AxeIDs;
ID := 6533;
R_Flag;
NPC := R_GetNPC(ID,true);
NPC_Tile := R_TileToMS(NPC.Tile, NPC.Height);
If(NPC.Name <> '')Then
Begin
Mouse(NPC_Tile.x, NPC_Tile.y, 0, 0, FALSE);
If(WaitOptionMultiEx(['ank'], 'action', ClickLeft, 1000))Then
Begin
Repeat
R_FindRandoms;
Wait(500 + Random(500));
If (R_PinScreen) Then
InPin(Players[CurrentPlayer].Pin);
Inc(Tries);
Until (R_BankScreen) Or (Tries > 10);
If (Tries > 10) Then
BankGE;
Wait(300 + Random(200));
If (R_BankScreen) Then
Begin
LogCount := R_CountItem(1521);
IncEx(TLogCount, LogCount);
IncEx(Players[CurrentPlayer].Integers[3], LogCount);
stats_IncVariable('Oak Logs Chopped', LogCount);
stats_IncVariable('Woodcutting EXP (Gained)', LogCount * 37);
R_DepositAllButEx(KeepIDs);
Writeln('Banked ' + IntToStr (LogCount) + ' oak logs');
Case Random(1) of
0 : CloseWindow;
End;
R_FindRandoms;
Inc(TBanked);
Inc(Players[CurrentPlayer].Integers[1]);
End;
End;
Wait(300 + Random(300));
If (InvFull) Then
BankGE;
End;
NPC := NULL_NPC;
End;

Procedure ProgressReport;
Var
I, LogPerHour, ExpPerHour, WoodcuttingLevelNow : Integer;
Begin
LogPerHour := ((LogCount * 3600) / (GetTimeRunning / 1000));
ExpPerHour := (LogPerHour * 37);
WoodcuttingLevelNow := GetSkillLevel(Skill_Woodcutting);
Players[CurrentPlayer].Integers[5] := WoodcuttingLevelNow;
SRLRandomsReport;
Writeln('[=====================================================]');
Writeln('[----(Whacko999: G.E Oak Chopper and Banker V1.04)----]');
Writeln('[=====================================================]');
Writeln('[= Overall ');
Writeln('[= Running For ' + MsToTime(GetTimeRunning, Time_Formal));
Writeln('[= Loads ' + IntToStr(TBanked) + ' times.');
Writeln('[= Chopped ' + IntToStr(TLogCount) + ' Logs.');
Writeln('[= Levels Gained ' + IntToStr(TLevels));
Writeln('[=====================================================]');
For i := 0 To High(Players) Do
Begin
LogPerHour := 0;
ExpPerHour := 0;
If(PlayerWorked(i) > 0)Then
Begin
LogPerHour := ((Players[i].Integers[3] * 3600) / (PlayerWorked(i) / 1000));
ExpPerHour := (LogPerHour * 37);
Writeln('[= Player ' + IntToStr(i));
Writeln('[= Active ' + BoolToStr(Players[i].Active));
Writeln('[= Worked ' + MsToTime(PlayerWorked(i), Time_Formal));
Writeln('[= Start WC Level: ' + IntToStr(Players[i].Integers[4]));
Writeln('[= Current WC Level: ' + IntToStr(Players[i].Integers[5]));
Writeln('[= Levels Gained ' + IntToStr(Players[i].Integers[2]));
Writeln('[= Loads ' + IntToStr(Players[i].Integers[1]));
Writeln('[= Logs Cut ' + IntToStr(Players[i].Integers[3]));
Writeln('[= Logs Cut Per Hour ' + IntToStr(LogPerHour));
Writeln('[= EXP Gained ' + IntToStr(Players[i].Integers[3] * 37));
Writeln('[= EXP Per Hour ' + IntToStr(ExpPerHour));
Writeln('[=====================================================]');
End;
End;
End;

Procedure MainLoop;
Begin
SWITCH := FALSE;
Repeat
LampSkill := Players[CurrentPlayer].Skill;
LoadsToDo := Players[CurrentPlayer].Integers[0];
If(Players[CurrentPlayer].Integers[4] = 0)Then
Begin
WoodCuttingLevelStart := GetSkillLevel(Skill_Woodcutting);
Players[CurrentPlayer].Integers[4] := WoodCuttingLevelStart;
End;
MarkTime(Start);
If (SWITCH_EVERY > 0) Then
Begin
SWITCH := TRUE;
SwitchChar := SWITCH_EVERY + RandomRange(1, 9);
Every := RandomRange(SWITCH_EVERY * 60000, SwitchChar * 60000);
WRiteln('Switching Every(MS): ' + IntToStr(Every));
WRiteln('Switching Every(Mins): ' + IntToStr(Every / 60000));
End;
Repeat
Banked := Players[CurrentPlayer].Integers[1];
Energy := R_GetMMLevels('run');
If (Not (Energy >= 50)) Then
Begin
Writeln ('Energy lower than 50, about to rest');
R_rest(99);
End;
GoToOaks;
CutOakTree;
GoToGE;
BankGE;
ProgressReport;
Writeln(IntToStr(Players[CurrentPlayer].Integers[1]) + '/' + IntToStr(LoadsToDo));
stats_IncVariable('Times Banked', 1);
stats_Commit();
writeln('Comitted stats');
Until (Not LoggedIn) Or (DoISwitchChar);
Wait(1000 + Random(1200));
If (Not LoggedIn) Then
NextPlayer(FALSE);
Until(AllPlayersInactive);
TerminateScript;
End;


Begin
Smart_Members := Are_You_MEMBERS;
Smart_Server := Witch_WORLD;
Smart_Signed := SIGNED;
Smart_SuperDetail := DETAIL;
SetupSRL;
R_UpdateHooks;
MouseSpeed := RandomRange(8, 18);
if (STATSUSERNAME = '') then
setupSRLStats(135, 'Anonymous', 'anon1337')
else
setupSRLStats(135, STATSUSERNAME, STATSPASSWORD);
DeclarePlayers;
LoginPlayer;
ClearDebug;
R_FindRandoms;
R_MakeCompass('N');
SetAngle(True);
If (InvFull) Then
Begin
GoToGE;
BankGE;
End;
AxeIDs := [1351, 1349, 1353, 1361, 1355, 1357, 1359, 6739];
AxeID := [1351, 1349, 1353, 1361, 1355, 1357, 1359, 6739];
If (Not HaveAxe) Then
Logout;
Energy := R_GetMMLevels('run');
If (Not (Energy >= 50)) Then
Begin
Writeln ('Energy lower than 50, about to rest');
R_rest(99);
End;
MainLoop;
End.

E: This seems to be where it fails
Function HaveAxe:Boolean;
Var
TheItem : TInvItemArray;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := (R_ItemExistsEx(AxeIDs, TheItem))Or(InIntArray(AxeID, R_GetEquippedIDAt(3)));
End;

From: masterBB
You could also create 2 folders, reflection and reflection2 in the include folder. Than at the top of every script you can select which one you want.


yeah i was thinking that but didn't wanna mess anything up and wanted to make sure everything was in the right place

pyroryan

2011-07-05 21:25:46

From: whacko999
Script I'm using

{//////////////////////////////////////////////////////////////////////////
// Whacko999: G.E Oak Chopper and Banker V1.04 //
// //
// Requirements: //
// Lev 15 (or higher) to cut oaks trees. //
// Must start to the east of the east banker at G.E //
// Have any hatchet wilded or in inventory. //
// Latest Simba with latest SRL and Reflection. //
// Setup players you want in (DeclarePlayers) section //
// //
// Features: //
// Will chop Oak trees to the east of the G.E and bank at G.E. //
// Will do amount of loads you want. //
// You can set the time of when you want players to switch //
// to the next player thats active. //
// Has good anti ban and finds randoms. //
// SRL Stats. //
// //
// Thanks for using my script: //
// Please leave any feedback or problems in the forums //
// //
// A massive THANKS to Rogeruk for everything you have helped me with. //
// //
//////////////////////////////////////////////////////////////////////////}


Program GEOakCutterBanker;
{$define SMART}
{$i srl/srl.scar}
{$i srl/srl/misc/stats.simba}
{$i SRl/SRL/Skill/woodcutting.scar}
{$i Reflection/Reflection.simba}

Const
WITCH_WORLD = 11;
ARE_YOU_MEMBERS = FALSE;
SIGNED = TRUE;
DETAIL = FALSE;
SWITCH_EVERY = 0; // How many minutes to change player (Leave as 0 to disable)
// SRL Stats.
STATSUSERNAME = ''; // your stats username here
STATSPASSWORD = ''; // your stats password here

Var
TLevels, TBanked, TLogCount, Banked, LogCount,
LoadsToDo, Start, Every, WoodCuttingLevelStart, SwitchChar, Energy: Integer;
AxeIDs: TVariantArray;
AxeID : TIntegerArray;
SWITCH : Boolean;

Procedure DeclarePlayers;
Begin
HowManyPlayers := 1;
NumberOfPlayers(HowManyPlayers);
CurrentPlayer := 0;

With Players[0] Do
Begin
Name := ''; //Your login name or email address.
Pass := ''; //Your players password.
Nick := ''; //3 letters of your on screen name Examp (Player123 = 'lay').
Active := TRUE; //Weather you want this player to be used or not (true = use).
Pin := ''; //Your players bank pin.
Integers[0] := 100; //How many TOTAL loads before setting false (Times Banked).
BoxRewards := ['amp']; //Reward you want from box after random.
Skill := 'woodcutting'; //Choose the xp you want from lamp.
End;

{ With Players[1] Do //To add players take away { << them, befor With and after End;
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Pin := '';
Integers[0] := 100;
BoxRewards := ['amp'];
Skill := 'woodcutting';
End; }

{ With Players[2] Do
Begin
Name := '';
Pass := '';
Nick := '';
Active := True;
Pin := '';
Integers[0] := 100;
BoxRewards := ['amp'];
Skill := 'woodcutting';
End; }

End;

Function ToOakPath: TPointArray;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := [Point(3195, 3486), Point(3194, 3460)];
End;


Function ToGEPath: TPointArray;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := [Point(3195, 3486), Point(3167, 3489)];
End;

///////////////////////////////////////
// Thanks to Rich for this function. //
// R_WebWalkPath. //
///////////////////////////////////////
Function R_WebWalkPath(Points : TPointArray; WaitTime, RandWait : Integer) : Boolean;
Var
I : Integer;
Begin
Result := False;
For I := 0 To High(Points) Do
Begin
If (Not (R_WindWalk(Points[I]))) Then
Begin
WriteLn('Could not walk to point (' + IntToStr(Points[I].X) + ', ' + IntToStr(Points[I].Y) + ')');
Exit;
End;
Wait(WaitTime + Random(RandWait));
End;
Result:= True;
End;

Function ClickOakTree: Boolean;
Var
OakID: Integer;
OakTree: TRSObject;
MSPoint: TPoint;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := FALSE;
R_FindRandoms;
OakID := 1281;
OakTree := R_GetObject(OakID, 0, 15);
If (OakTree.ID > 0) Then
Begin
MSPoint := R_TileToMS(OakTree.Tile, 0);
Mouse(MSPoint.X, MSPoint.Y - 40, 6, 6, TRUE);
Result := TRUE;
End;
OakTree := NULL_RSOBJECT;
End;

Function FindOakTree: Boolean;
Var
OakID: Integer;
OakTree: TRSObject;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := FALSE;
R_FindRandoms;
OakID := 1281;
OakTree := R_GetObject(OakID, 0, 15);
If (OakTree.ID > 0) And (R_TileOnMS(OakTree.Tile, 0)) Then
Result := TRUE;
OakTree := NULL_RSOBJECT;
End;

Function HaveAxe:Boolean;
Var
TheItem : TInvItemArray;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := (R_ItemExistsEx(AxeIDs, TheItem))Or(InIntArray(AxeID, R_GetEquippedIDAt(3)));
End;

Function DoISwitchChar: Boolean;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := FALSE;
If (Banked >= LoadsToDo) Then
Begin
Writeln('Player has done all its loads!');
NextPlayer(FALSE);
Result := TRUE;
End;
If (SWITCH) Then
Begin
If (PlayersActive > 1) Then
Begin
If (TimeFromMark(Start) >= Every) Then
Begin
Writeln('Player has done its time!');
NextPlayer(TRUE);
Result := TRUE;
End;
End;
End;
End;

Function IsChopping: Boolean;
Var
Animations: TIntegerArray;
Begin
If (Not (LoggedIn)) Then
Exit;
Result := FALSE;
Animations := [867, 869, 871, 873, 875, 877, 879];
If (InIntArray(Animations, R_GetAnimation)) Then
Result := TRUE;
End;

Procedure GoToOaks;
Begin
If (Not (LoggedIn)) Then
Exit;
If (FindOakTree) Then
Exit;
Writeln('Walking to the oak trees');
SetRun(TRUE);
R_WebWalkPath(ToOakPath, 2500, 1500);
R_MakeCompass('N');
SetAngle(True);
If (FindOakTree) Then
Begin
Writeln('Found Oak Trees');
End;
End;

Procedure GoToGE;
Begin
If (Not (LoggedIn)) Then
Exit;
Writeln('Invetory full going bank');
SetRun(TRUE);
R_WebWalkPath(ToGEPath, 2500, 1500);
R_MakeCompass('N');
SetAngle(True);
Writeln('At the bank');
End;

Procedure DoRandomMovement;
Var
Keys: TIntegerArray;
T: Integer;
Begin
If (Not (LoggedIn)) Then
Exit;
Keys := [VK_RIGHT, VK_LEFT];
T := Random(2);
If (Random(2) = T) Then
Begin
ActivateClient;
Wait(100 + Random(50));
KeyDown(Keys[T]);
Wait(500 + Random(1000));
KeyUp(Keys[T]);
Wait(500 + Random(1000));
SetAngle(true);
End Else If (Random(3) = 0) Then
SleepAndMoveMouse(1000 + Random(200));
End;

Procedure Antiban;
Begin
If (Not (LoggedIn)) Then
Exit;
Case Random(200) Of
150..155:
Begin
GameTab(RandomRange(tab_Combat, tab_Logout));
Wait(900 + Random(1000));
End;
110..115: PickUpMouse;
70..80: DoRandomMovement;
40..42: HoverSkill('Woodcutting', FALSE);
1..5: SleepAndMoveMouse(1000 + Random(500));
End;
End;

Procedure CutOakTree;
Var
Tries: Integer;
Begin
If (Not (LoggedIn)) Then
Exit;
R_FindRandoms;
Tries := 0;
If (ClickOakTree) Then
Begin
Writeln('Chopping Oak Tree');
Repeat
R_FindRandoms;
If (LevelUp) Then
Begin
Inc(TLevels);
Inc(Players[CurrentPlayer].Integers[2]);
stats_IncVariable('Total Levels Gained', 1);
End;
Wait(500 + Random(800));
Inc(Tries);
If (InvFull) Then
Exit;
Until (IsChopping) Or (Tries > 4);
While (IsChopping) Do
Begin
R_FindRandoms;
If (LevelUp) Then
Begin
Inc(TLevels);
Inc(Players[CurrentPlayer].Integers[2]);
stats_IncVariable('Total Levels Gained', 1);
End;
Wait(500 + Random(1000));
Antiban;
If (LevelUp) Then
Begin
Inc(TLevels);
Inc(Players[CurrentPlayer].Integers[2]);
stats_IncVariable('Total Levels Gained', 1);
End;
If (InvFull) Then
Exit;
End;
End;
Wait(300 + Random(300));
If (Not InvFull) Then
CutOakTree;
End;

Procedure BankGE;
Var
KeepIDs: TVariantArray;
ID: Integer;
NPC: TNPC;
NPC_Tile: TPoint;
Tries: Integer;
Begin
If (Not (LoggedIn)) Then
Exit;
Status('About to bank');
Tries := 0;
KeepIDs := AxeIDs;
ID := 6533;
R_Flag;
NPC := R_GetNPC(ID,true);
NPC_Tile := R_TileToMS(NPC.Tile, NPC.Height);
If(NPC.Name <> '')Then
Begin
Mouse(NPC_Tile.x, NPC_Tile.y, 0, 0, FALSE);
If(WaitOptionMultiEx(['ank'], 'action', ClickLeft, 1000))Then
Begin
Repeat
R_FindRandoms;
Wait(500 + Random(500));
If (R_PinScreen) Then
InPin(Players[CurrentPlayer].Pin);
Inc(Tries);
Until (R_BankScreen) Or (Tries > 10);
If (Tries > 10) Then
BankGE;
Wait(300 + Random(200));
If (R_BankScreen) Then
Begin
LogCount := R_CountItem(1521);
IncEx(TLogCount, LogCount);
IncEx(Players[CurrentPlayer].Integers[3], LogCount);
stats_IncVariable('Oak Logs Chopped', LogCount);
stats_IncVariable('Woodcutting EXP (Gained)', LogCount * 37);
R_DepositAllButEx(KeepIDs);
Writeln('Banked ' + IntToStr (LogCount) + ' oak logs');
Case Random(1) of
0 : CloseWindow;
End;
R_FindRandoms;
Inc(TBanked);
Inc(Players[CurrentPlayer].Integers[1]);
End;
End;
Wait(300 + Random(300));
If (InvFull) Then
BankGE;
End;
NPC := NULL_NPC;
End;

Procedure ProgressReport;
Var
I, LogPerHour, ExpPerHour, WoodcuttingLevelNow : Integer;
Begin
LogPerHour := ((LogCount * 3600) / (GetTimeRunning / 1000));
ExpPerHour := (LogPerHour * 37);
WoodcuttingLevelNow := GetSkillLevel(Skill_Woodcutting);
Players[CurrentPlayer].Integers[5] := WoodcuttingLevelNow;
SRLRandomsReport;
Writeln('[=====================================================]');
Writeln('[----(Whacko999: G.E Oak Chopper and Banker V1.04)----]');
Writeln('[=====================================================]');
Writeln('[= Overall ');
Writeln('[= Running For ' + MsToTime(GetTimeRunning, Time_Formal));
Writeln('[= Loads ' + IntToStr(TBanked) + ' times.');
Writeln('[= Chopped ' + IntToStr(TLogCount) + ' Logs.');
Writeln('[= Levels Gained ' + IntToStr(TLevels));
Writeln('[=====================================================]');
For i := 0 To High(Players) Do
Begin
LogPerHour := 0;
ExpPerHour := 0;
If(PlayerWorked(i) > 0)Then
Begin
LogPerHour := ((Players[i].Integers[3] * 3600) / (PlayerWorked(i) / 1000));
ExpPerHour := (LogPerHour * 37);
Writeln('[= Player ' + IntToStr(i));
Writeln('[= Active ' + BoolToStr(Players[i].Active));
Writeln('[= Worked ' + MsToTime(PlayerWorked(i), Time_Formal));
Writeln('[= Start WC Level: ' + IntToStr(Players[i].Integers[4]));
Writeln('[= Current WC Level: ' + IntToStr(Players[i].Integers[5]));
Writeln('[= Levels Gained ' + IntToStr(Players[i].Integers[2]));
Writeln('[= Loads ' + IntToStr(Players[i].Integers[1]));
Writeln('[= Logs Cut ' + IntToStr(Players[i].Integers[3]));
Writeln('[= Logs Cut Per Hour ' + IntToStr(LogPerHour));
Writeln('[= EXP Gained ' + IntToStr(Players[i].Integers[3] * 37));
Writeln('[= EXP Per Hour ' + IntToStr(ExpPerHour));
Writeln('[=====================================================]');
End;
End;
End;

Procedure MainLoop;
Begin
SWITCH := FALSE;
Repeat
LampSkill := Players[CurrentPlayer].Skill;
LoadsToDo := Players[CurrentPlayer].Integers[0];
If(Players[CurrentPlayer].Integers[4] = 0)Then
Begin
WoodCuttingLevelStart := GetSkillLevel(Skill_Woodcutting);
Players[CurrentPlayer].Integers[4] := WoodCuttingLevelStart;
End;
MarkTime(Start);
If (SWITCH_EVERY > 0) Then
Begin
SWITCH := TRUE;
SwitchChar := SWITCH_EVERY + RandomRange(1, 9);
Every := RandomRange(SWITCH_EVERY * 60000, SwitchChar * 60000);
WRiteln('Switching Every(MS): ' + IntToStr(Every));
WRiteln('Switching Every(Mins): ' + IntToStr(Every / 60000));
End;
Repeat
Banked := Players[CurrentPlayer].Integers[1];
Energy := R_GetMMLevels('run');
If (Not (Energy >= 50)) Then
Begin
Writeln ('Energy lower than 50, about to rest');
R_rest(99);
End;
GoToOaks;
CutOakTree;
GoToGE;
BankGE;
ProgressReport;
Writeln(IntToStr(Players[CurrentPlayer].Integers[1]) + '/' + IntToStr(LoadsToDo));
stats_IncVariable('Times Banked', 1);
stats_Commit();
writeln('Comitted stats');
Until (Not LoggedIn) Or (DoISwitchChar);
Wait(1000 + Random(1200));
If (Not LoggedIn) Then
NextPlayer(FALSE);
Until(AllPlayersInactive);
TerminateScript;
End;


Begin
Smart_Members := Are_You_MEMBERS;
Smart_Server := Witch_WORLD;
Smart_Signed := SIGNED;
Smart_SuperDetail := DETAIL;
SetupSRL;
R_UpdateHooks;
MouseSpeed := RandomRange(8, 18);
if (STATSUSERNAME = '') then
setupSRLStats(135, 'Anonymous', 'anon1337')
else
setupSRLStats(135, STATSUSERNAME, STATSPASSWORD);
DeclarePlayers;
LoginPlayer;
ClearDebug;
R_FindRandoms;
R_MakeCompass('N');
SetAngle(True);
If (InvFull) Then
Begin
GoToGE;
BankGE;
End;
AxeIDs := [1351, 1349, 1353, 1361, 1355, 1357, 1359, 6739];
AxeID := [1351, 1349, 1353, 1361, 1355, 1357, 1359, 6739];
If (Not HaveAxe) Then
Logout;
Energy := R_GetMMLevels('run');
If (Not (Energy >= 50)) Then
Begin
Writeln ('Energy lower than 50, about to rest');
R_rest(99);
End;
MainLoop;
End.


Line 142
OakTree := R_GetObject(OakID, 0, 15);
to
OakTree := R_GetObject(OakID, 1, 15);

Line 174
Result := (R_ItemExistsEx(AxeIDs, TheItem))Or(InIntArray(AxeID, R_GetEquippedIDAt(3)));
to
Result := (R_ItemExistsEx(AxeIDs, TheItem))Or(InIntArray(AxeID, R_GetEquippedIDAt(EQUIPMENT_WEAPON)));
There might be other mistakes. But that should make it at least start chopping.

Edit: Also forgot to say that I didn't get the Interface error.

Jakkle

2011-07-05 21:39:31

From: pyroryan

Line 142
OakTree := R_GetObject(OakID, 0, 15);
to
OakTree := R_GetObject(OakID, 1, 15);

Line 174
Result := (R_ItemExistsEx(AxeIDs, TheItem))Or(InIntArray(AxeID, R_GetEquippedIDAt(3)));
to
Result := (R_ItemExistsEx(AxeIDs, TheItem))Or(InIntArray(AxeID, R_GetEquippedIDAt(EQUIPMENT_WEAPON)));
There might be other mistakes. But that should make it at least start chopping.

Edit: Also forgot to say that I didn't get the Interface error.


them lines fixed it, I get wht to do now as well :P TYVM pyroryan

E: I should of looked at this first :rolleyes:
Constants used for these functions:
EQUIPMENT_HELMET = 8;
EQUIPMENT_CAPE = 11;
EQUIPMENT_NECKLACE = 14;
EQUIPMENT_WEAPON = 17;
EQUIPMENT_TORSO = 20;
EQUIPMENT_SHIELD = 23;
EQUIPMENT_LEGS = 26;
EQUIPMENT_GLOVES = 29;
EQUIPMENT_BOOTS = 32;
EQUIPMENT_RING = 35;
EQUIPMENT_AMMO = 38;

E: I have changed my F2P Runecrafter into ref 2 and have been watching it run. All I can say is, AMAZING, so far. I'm REALLY LIKING the clicking of objects. Rather than finding the closest tile to click it finds the center tile of the object <3. Thank you drags :D

Lancelot074

2011-07-05 22:18:01

Mine still can't find the inventory interface. Here's the code I'm using.

function checkGear: Boolean;//Wanted to see if the R_ItemExists was the problem
var
i, ii, iii: TInvItem;
begin
Result := False;
if R_CountItem(NetID) > 0 then
begin
Players[CurrentPlayer].Strings[0] := 'Net';
Result := True;
end;
if (R_ItemExists(RodID, ii) and R_ItemExists(BaitID, iii)) then
begin
Players[CurrentPlayer].Strings[0] := 'Bait';
Result := True;
end;
end;

Any help is appreciated, thanks.

Flight

2011-07-05 23:15:43

Git looks a bit complicated for me, between setting up the account, installing it on the computer, making the key, creating the repository, ect ect… Is there any alternatives to posting my progress and modifications?

Dgby714

2011-07-05 23:18:40

From: Flight
Git looks a bit complicated for me, between setting up the account, installing it on the computer, making the key, creating the repository, ect ect… Is there any alternatives to posting my progress and modifications?


It is pretty easy, if you don't wanna go thru github, git by itself can create patch files you can pass to a developer.

pyroryan

2011-07-05 23:20:21

From: Flight
Git looks a bit complicated for me, between setting up the account, installing it on the computer, making the key, creating the repository, ect ect… Is there any alternatives to posting my progress and modifications?


I personally favor Subversion, but lots of people like Git. I would suggest you at least learn how to use Git. But if you're too busy to, you're more than welcome to post the changes on the reflection forums. Someone might be nice enough to create a pull request for you or I'll integrate the changes myself.

Drakan

2011-07-05 23:23:14

What is your character doing when you're searching your inventory? If you have everything updated it should work. I'm on an iPod right now in a hotel so I dont have the resources to test or anything. When did the interface change pyro? Thanks for the find ;)

mormonman

2011-07-05 23:41:47

From: drags111
What is your character doing when you're searching your inventory? If you have everything updated it should work. I'm on an iPod right now in a hotel so I dont have the resources to test or anything. When did the interface change pyro? Thanks for the find ;)


Today's update.

Lancelot074

2011-07-06 00:38:46

From: drags111
What is your character doing when you're searching your inventory? If you have everything updated it should work. I'm on an iPod right now in a hotel so I dont have the resources to test or anything. When did the interface change pyro? Thanks for the find ;)


I set the script to log in, wait 15 seconds for everything to load, and then check the inventory for the gear, which is when it says interface not found.

Jakkle

2011-07-06 06:14:48

From: Lancelot074
I set the script to log in, wait 15 seconds for everything to load, and then check the inventory for the gear, which is when it says interface not found.


Re-download everything from git and replace the old (ref2) files, make sure you have
 
SetupSRL;
R_UpdateHooks; <---
Run the script.
Try that also like masterBB said make 2 reflections Ex.. (Reflection.simba and reflection2.simba.
Call witch 1 you want in the script,
{$i Reflection/Reflection.simba}
{$i Reflection/Reflection2.simba}

Flight

2011-07-06 06:57:32

The Anti-Randoms just need to be converted over to R2 and we can stably replace all current Reflection with R2.

Jakkle

2011-07-06 07:28:06

From: Flight
The Anti-Randoms just need to be converted over to R2 and we can stably replace all current Reflection with R2.


Drags was sorting out alot of the antirandoms, I was helping him with accounts. He said not to long ago, as I pm'ed him with accounts.

From: drags111
I actually had to rewrite the include because of speed issues with the wrappers I was using so im trying to finish that up, which I'm almost done. Then i'll get back to randoms =]


But he's had to go away so I think quite alot of the randoms are sorted but there are some that need attention and to be fixed.

I also think it's a bit to soon to say that its ALL stable apart from randoms, don't you think ? :D

@ pyroryan can you do the fixing of randoms if I get you accounts in randoms ?

Flight

2011-07-06 07:42:44

From: whacko999

I also think it's a bit to soon to say that its ALL stable apart from randoms, don't you think ? :D


There's not a whole lot missing, and from that handful even smaller are absolute necessities. I've converted 2 of my scripts over to R2 and they've been running smooth as silk for over an hour each. Tiles, banking, player variables, MMWalking, inventory, and now I added levels/experience, they all check out fine, but I've yet to test any NPC or Object routines.

From: whacko999

@ pyroryan can you do the fixing of randoms if I get you accounts in randoms ?


I think TRileZ can help us when it comes to randoms. :rolleyes:

Jakkle

2011-07-06 07:50:35

From: Flight
There's not a whole lot missing, and from that handful even smaller are absolute necessities. I've converted 2 of my scripts over to R2 and they've been running smooth as silk for over an hour each. Tiles, banking, player variables, MMWalking, inventory, and now I added levels/experience, they all check out fine, but I've yet to test any NPC or Object routines.


Well tbh I do agree lol :p, object finding as I have already said is sexy <3. It clicks the centre tile, so much more human like and gives you a bigger random click area. It's had no problem as far as I can see with ncp's.

I think TRileZ can help us when it comes to randoms. :rolleyes:


Ok well who ever it is, I have account for them :)

Drakan

2011-07-06 09:08:42

It's not ready till we've had extensive testing. Pyro is too busy for randoms but I haven't asked trilez yet. Flight as far as your experiences go, I'm wondering if that should be included in GetMe or if they should be standalone functions. If they are part of GetMe then thats wasted ms for those not wanting the experience crap and vis versa (sp). However feel free to make some standalone functions. I believe I had some in my first reflection 2 but forgot to add those in. I don't want the old randoms from reflection 1 copied straight to ref2. Those randoms were very unreliable and unstable. Everything should be rewritten.

Flight

2011-07-06 11:55:33

From: drags111
It's not ready till we've had extensive testing. Pyro is too busy for randoms but I haven't asked trilez yet. Flight as far as your experiences go, I'm wondering if that should be included in GetMe or if they should be standalone functions. If they are part of GetMe then thats wasted ms for those not wanting the experience crap and vis versa (sp). However feel free to make some standalone functions. I believe I had some in my first reflection 2 but forgot to add those in. I don't want the old randoms from reflection 1 copied straight to ref2. Those randoms were very unreliable and unstable. Everything should be rewritten.


I sure didn't think about that, but now it makes sense. Every time you're using R_GetMe you're loading everything within the function for your player, even if all your wanting is a certain level, it still loads everything. Maybe it wouldn't be anything noticeable to parse such functions, but I think it would be more efficient and less chance of something being leaked. I think you're right about making stand alone functions, I think I'll do that. I'll try making a test function in the morning to hook both the player's Levels and Experience only and see how that turns out.

About the anti randoms, I suppose I could, at the least, skim over some of them to see how they were solved before. If I have any ideas I'll toss them around with someone on the Dev team, maybe TRileZ might have some pointers for us in the area.

Yago

2011-07-06 16:07:38

There aren't Tiles anymore right?

Edit: Also, what replaced GetPlaneIndex?

Lancelot074

2011-07-06 16:28:41

Even when I comment everything and anything about the inventory in my script (mostly just checking for gear and stuff) it still spams the debug box with this:
[Reflection] The Inventory interface doesn't exist!

Even after updating multiple times, it still happens. >.<

EDIT: Nevermind fixed it. The commited interface ID was different than the actual one, or maybe I messed up somehow.

Yago

2011-07-06 19:11:51

From: whacko999
I'm REALLY LIKING the clicking of objects. Rather than finding the closest tile to click it finds the center tile of the object <3. Thank you drags :D


How are you doing this ^^^?

Flight

2011-07-06 21:08:59

From: Yago
There aren't Tiles anymore right?

Edit: Also, what replaced GetPlaneIndex?


There are tiles, this is how I declared them in my R2 script. (Which works successfully by the way)
Global variable:

FTile: TTile;

Loading the script based on the user's preference, this is declared:

FTile := Point(3110,3502);
So we replace, what would have been, "Tile(3110,3502);" with 'Point' instead. Same result, works fine.


From: Lancelot074

Even after updating multiple times, it still happens. >.<


Ok to fix this, go to 'lib > core > constants.simba' and find this: (should be near the top)
{Inventory Constants}
INTERFACE_INVENTORY = 149;
INTERFACE_BANKINVENTORY = 763;
Replace the '149' with '679' (This is the interface ID for the Inventory, it was recently changed so we much update it). Save (NOT COMPILE), and close. Now try running your script. :)

Yago

2011-07-06 21:12:31

R_ClickInterface isn't working for me…

Edit: Seems that TInterfaceComponent.bounds and width and height are returning 0 and the x and y is returning a weird co-ord…

Lancelot074

2011-07-06 21:15:14

Flight, I edited my post as soon as you posted. xD
I'm also wondering how to check the my characters plane now that getplaneindex is gone.

Flight

2011-07-06 21:53:44

As in checking their location or if they're within a certain X/Y region?

"R_GetMyPos" for your current location, and something like this for determining if you're within a set region:

PointInBox(R_GetMyPos,IntToBox(X1,Y1,X2,Y2))

Hope that helps.

Bobarkinator

2011-07-07 00:23:14

Hey, glad you released this. Haven't talked to you in a while…like a year and a half…

KingKong

2011-07-07 02:27:42

Just a question, how come getskilllevel and getskillexperience and other stuff in ref1 haven't been included in ref2? Im pretty sure they don't have mem leaks.

Lancelot074

2011-07-07 02:54:56

Does R_SelfInBox or PointInBox work for anybody else, I tried using them but came up with no results.

mormonman

2011-07-07 08:40:21

From: KingKong
Just a question, how come getskilllevel and getskillexperience and other stuff in ref1 haven't been included in ref2? Im pretty sure they don't have mem leaks.


Cuz it's a beta and he didn't notice that it wasn't in 2.1

Yago

2011-07-07 09:57:36

From: Yago
R_ClickInterface isn't working for me…

Edit: Seems that TInterfaceComponent.bounds and width and height are returning 0 and the x and y is returning a weird co-ord…


Bump this…
Also, can we have getplaneindex?

masterBB

2011-07-07 10:19:52

From: Lancelot074
Does R_SelfInBox or PointInBox work for anybody else, I tried using them but came up with no results.


PointInBox just works here…
writeln(PointInBox(Point(5,5),IntToBox(0,0,10,10))); 

From: Yago
Bump this…
Also, can we have getplaneindex?


Do I need to write that function for you? What do you want to use it for?

Yago

2011-07-07 10:24:21

From: masterBB
Do I need to write that function for you? What do you want to use it for?


It checks what floor your on… so like underground or in a building…

Also, can you check to see if interfaces are working…?

Thank-you

pyroryan

2011-07-07 10:28:54

From: Yago
Also, can we have getplaneindex?


Added R_GetPlaneIndex.

Yago

2011-07-07 10:32:55

From: pyroryan
Added R_GetPlaneIndex.


Thank-you… I know I require a lot so… Interfaces?

masterBB

2011-07-07 10:34:57

From: Yago
Thank-you… I know I require a lot so… Interfaces?


writeln(R_GetValidInterfaces);

returns:
[]

So no, they aren't working.

edit: I used the wrong hooks, they are working.

Yago

2011-07-07 12:16:41

From: masterBB
writeln(R_GetValidInterfaces);

returns:
[]

So no, they aren't working.

edit: I used the wrong hooks, they are working.


The hooks got updated?

masterBB

2011-07-07 12:47:23

From: Yago
The hooks got updated?


The newest.

const
ClientVersion = 656;
HookRev = 1;

The auto updater from ref 2 just didn't worked.

Yago

2011-07-07 12:50:43

From: masterBB
The newest.

const
ClientVersion = 656;
HookRev = 1;

The auto updater from ref 2 just didn't worked.


Those hooks were still giving me problems with interfaces…

masterBB

2011-07-07 13:08:41

From: Yago
Those hooks were still giving me problems with interfaces…


Give me the interface number + child and component nr if used. It works perfect here. I debug those interfaces great, and the bounds aren't off.

Drakan

2011-07-07 13:31:46

Im glad most of you are doing well with this! I just got a break at my sister's house, so this will be my one post for a while. Like I said it's not 100% complete. I don't have every single thing in here, but that's why we have this community. Work together and submit pull requests, etc.

@Yago: I am unable to test anything but according to masterbb the interface clicking is doing great, so it is probably something you are doing wrong.

@pyroryan: thanks for keeping up with commits for functions people need! I really appreciate that!

@Bobarkinator: Holy crap dude where you been!? You coming back to the scene? We'll have to talk more when I get home from this trip.

There could be new problems because of the apparent interface changes but I have no reports of it not working right. Any testing and results posted here is much appreciated! Other than that, it seems that things are going well. Has anyone had any crashes yet or any bugs to report? Thank you everyone for helpin out and testing!

Yago

2011-07-07 22:53:38

Well it turns out it was me screwing up the script… But yeah. thanks guys for the help

Yago

2011-07-07 23:02:45

From: Yago
Well it turns out it was me screwing up the script… But yeah. thanks guys for the help


So about R_GetSkillLevel…

Bobarkinator

2011-07-07 23:40:43

From: drags111

@Bobarkinator: Holy crap dude where you been!? You coming back to the scene? We'll have to talk more when I get home from this trip.


I don't know. I might at least come back to the community. Yes, let's talk more.

mormonman

2011-07-08 01:10:55

Pyro, pull my request. https://github.com/Drags111/Reflection_Dev/pull/7

masterBB

2011-07-08 06:51:29

From: Yago
So about R_GetSkillLevel…



badcode;
//eddited out :)

edit:


function R_GetSkillLevel(skill:Integer): Integer;
begin
Result := SmartGetFieldArrayInt(0, hook_static_GetSkillLevels, skill);
end;

edit 2:

function R_GetSkillLevels: Array of Integer;
var
numSkills,i: Integer;
begin
numSkills := SmartGetFieldArraySize(0, hook_static_GetSkillLevels, 1);
setLength(Result,numSkills);
for i := 0 to numSkills-1 do
Result[i] := SmartGetFieldArrayInt(0, hook_static_GetSkillLevels, i);
end;

Last edit:


function R_GetSkillExperience(skill:Integer): Integer;
begin
Result := SmartGetFieldArrayInt(0, hook_static_GetSkillExperiences, skill);
end;

function R_GetSkillExperiences: Array of Integer;
var
numSkills,i: Integer;
begin
numSkills := SmartGetFieldArraySize(0, hook_static_GetSkillExperiences, 1);
setLength(Result,numSkills);
for i := 0 to numSkills-1 do
Result[i] := SmartGetFieldArrayInt(0, hook_static_GetSkillExperiences, i);
end;

edit 4:
OMG, I created something that already existed… Should check all comments before writing these kind of things.

Yago

2011-07-08 11:36:38

From: masterBB

edit 4:
OMG, I created something that already existed… Should check all comments before writing these kind of things.


lol definitely… could some push this?

How's model clicking coming along?

Drakan

2011-07-08 11:40:43

Development hasn't progressed on model clicking.Those sorts of things will not be added until reflection 2 is stable and fully released. We do have plans for them once that occurs (model clicking, web walking, etc). For now though, we want to focus on randoms and extensive testing: search for bugs and crashes and the likes.

Yago

2011-07-08 13:08:49

I get this
(-1, -1)
when running this
writeln(tostr(R_GetMyPos));

masterBB

2011-07-08 13:11:26

From: Yago
I get this
(-1, -1)
when running this
writeln(tostr(R_GetMyPos));


Will check it for you.

edit: Works for me:
(2793, 9579)

Yago

2011-07-08 13:20:04

From: masterBB
Will check it for you.

edit: Works for me:
(2793, 9579)


Did new hooks come out? I have gotten no updates for reflection…

Edit: I have 656 # 1

Edit2: For some reason its working again for me… After I move my char

pyroryan

2011-07-08 21:28:01

Just finished dealing with most of the pull requests.

KingKong

2011-07-08 23:52:30

Just looked though the bank.simba file and saw that r_openbankbooth doesn't take an argument, is this a good idea? because it has to load all the extra TPointArrays and sort through them and this increases mem usage if used over a long period(like superheaters)

E: It doesn't open Ge bank as well(neither did the old ref), done on purpose or left it?

Drakan

2011-07-09 00:55:48

From: KingKong
Just looked though the bank.simba file and saw that r_openbankbooth doesn't take an argument, is this a good idea? because it has to load all the extra TPointArrays and sort through them and this increases mem usage if used over a long period(like superheaters)

E: It doesn't open Ge bank as well(neither did the old ref), done on purpose or left it?


Well it shouldn't take up mem usage over time. It's not like the memory usage adds up each time and is never released (that is what we would call memory leaks). And that really is a small number of tiles to load. If it was something that was called numerous times within a short amount of time (seconds) that could impact performance, but it's my belief that since you just call it once every 30 seconds at most, the ends justify the means. It does solve a bit of hassle trying to locate what bank you are at. You would have to hardcode detection into your script and do all that crap. With this you just call it and it will automatically detect the nearest booth.

Tl:dr; it won't take up more memory usage when using in short periods of time.

Jakkle

2011-07-09 10:57:29

Having a problem with clicking on the bankers in draynor, clicks behind the bankers instead.
Every other banker I've tried is fine.

Drakan

2011-07-09 21:24:33

Interesting. Clicking bankers or bank booths?

Jakkle

2011-07-10 08:31:01

From: drags111
Interesting. Clicking bankers or bank booths?


The bankers not the booths, not tried bank booths yet.

Smarter Child

2011-07-10 21:18:35

At certain points of my script when I call WalkPathEx/WalkPath, i get Out of Range at line 606 in Mapwalk.simba..I know this is probably my fault, however is there anyway I can fix this or prevent it from occurring ?

Error: Out Of Range at line 606

Yago

2011-07-10 21:28:33

From: Smarter Child
At certain points of my script when I call WalkPathEx/WalkPath, i get Out of Range at line 606 in Mapwalk.simba..I know this is probably my fault, however is there anyway I can fix this or prevent it from occurring ?

Error: Out Of Range at line 606


I submitted a pull request a while ago… And am being ignored???

My pull request are just growing…

Flight

2011-07-10 21:54:16

I'm having quite a few problems with both tiles and R_WalkPathEx as well.

Drakan

2011-07-10 23:03:20

You guys are going to have to be more specific of you want some help. Print whole procedures and comment bad lines. I am using an iPod to check the messages.

Smarter Child

2011-07-10 23:32:35

From: drags111
You guys are going to have to be more specific of you want some help. Print whole procedures and comment bad lines. I am using an iPod to check the messages.


WalkPathEx is semi-broken; gets out of range errors.

[Line 606]

May be resort to old WalkPath, or look at both and see what's wrong :)

Yago

2011-07-10 23:49:39

Again I fixed R_WalkPathEx —- someone just need to commit it…

On A Side Note, R_DepositAllbut(cballID) doesn't work when depositing cannonballs….

My Edits explain this:

Edit: I believe that it fails since cannonballs contains the word "all" which is used in R_chooseoption('all') and it mistakes all for cannonballs…


Edit2: I fixed it by changing R_chooseoption('all') to R_chooseoption('-all')

Edit3: Will commit this… someone push please

Brandon

2011-07-11 20:13:51


var
PathToWalk: TTileArray;

begin
WalkPathLogs = [TTile(3498, 3483), TTile(3504, 3482), TTile(3512, 3480)];
R_WalkPath(WalkPathLogs);
end;

//Compiler output.
[Error] Closing parenthesis expected at line 147
Compiling failed.

Also Fails when I do this (same error about parenthesis):


var
MyPos: TTile;
begin
MyPos:= R_GetMyPos;
If(MyPos = TTile(3512, 3480))
end;

Bonfield

2011-07-11 20:39:18

I dont think you can declare a TTileArray like that, i could be wrong though I haven't scripted in a while

Smarter Child

2011-07-11 21:12:32

From: Bonfield
I dont think you can declare a TTileArray like that, i could be wrong though I haven't scripted in a while


Pretty sure you use an Array of TPoints now.

Bonfield

2011-07-11 21:42:06

I know afaik you always could, I remember before you never used an array of tiles, it was always TPAs that was also when drags was the cheese? (not sure though)

I think it's how he declared it though

Brandon

2011-07-11 21:44:33

Ok Well I got it using Points. Thanks and uhh Can you guys get banking to work in canifis? I edited the bank file so that it has:


SetLength(BankTiles, 19);

//Canifis
BankTiles[18] := [Point(3513, 3478), Point(3513, 3479), Point(3513, 3480),
Point(3513, 3481), Point(3513, 3482), Point(3513, 3483)];

It won't find the booth.. I checked all the tiles with an object finder, it says its right, tried to find them with RSBot, the tiles are 100% correct.. it just won't click it at all..

Bonfield

2011-07-11 21:51:46

It won't find the bank? Or doesn't think the tiles are there?

Can you open it through the npc?

Also how did you fix the point problem?

Smarter Child

2011-07-11 21:58:31

just use FindNPC as a failsafe to find the banker as a tempfix for now.

Brandon

2011-07-11 22:49:18

I got it.. I had to use the new hooks.. apparently the Hooks for ref 2 are outdated badly.. I noticed that it said Inventory interface wasn't found then I realized it was the hooks..

As for the Point thing I just used TPointArray instead of TTileArray.. and changed all of them from TTile(x,y) to Point(x,y)..

One huge problem though is that sometimes smart will lose focus and it will start using my actual mouse and clicking co-ordinates on my screen rather than smart.. Damn.. I had to use SmartClickMouse(x,y, true); to get around that..
ClickMouse(x,y, 1); has bad glitches :c

Yago

2011-07-11 22:50:10

From: ggzz
I got it.. I had to use the new hooks.. apparently the Hooks for ref 2 are outdated badly.. I noticed that it said Inventory interface wasn't found then I realized it was the hooks..

As for the Point thing I just used TPointArray instead of TTileArray.. and changed all of them from TTile(x,y) to Point(x,y)..

One huge problem though is that sometimes smart will lose focus and it will start using my actual mouse and clicking co-ordinates on my screen rather than smart.. Damn.. I had to use SmartClickMouse(x,y, true); to get around that..
ClickMouse(x,y, 1); has bad glitches :c


Just use Mouse or MMouse with ClickMouse2(true/false)

TomTuff

2011-07-12 01:37:49

why doesn't the default branch work? I have compiling issues. I have to do two things to fix it:
Change all the {$include_once ___} to {$i ___}
Include several randoms files

Nava2

2011-07-12 02:03:49

From: TomTuff
why doesn't the default branch work? I have compiling issues. I have to do two things to fix it:
Change all the {$include_once ___} to {$i ___}
Include several randoms files


Drags probably never merged the branches. I can do this tomorrow.

TomTuff

2011-07-12 02:19:50

From: Nava2
Drags probably never merged the branches. I can do this tomorrow.


I submitted a pull request with the fix, regardless.

Brandon

2011-07-12 06:04:01

repeat
R_DepositAllButEx([HouseTab, SickleB]);
until(R_ItemExists(FungusID, InvItem) = false);

Does not work.. Hooks are up to date. R_DepositAllBy(ID); Doesn't work either..

**BANNED The Man

2011-07-12 07:27:31

From: ggzz
repeat
R_DepositAllButEx([HouseTab, SickleB]);
until(R_ItemExists(FungusID, InvItem) = false);

Does not work.. Hooks are up to date. R_DepositAllBy(ID); Doesn't work either..


Does it compile?
Else do:

repeat
R_DepositAllButEx([HouseTab, SickleB]);
until not (R_ItemExists(FungusID, InvItem));

Flight

2011-07-12 08:30:47

From: TomTuff
why doesn't the default branch work? I have compiling issues. I have to do two things to fix it:
Change all the {$include_once ___} to {$i ___}
Include several randoms files


This explains why I was having trouble with Simba 820 being able to compile R2.

Nava2

2011-07-12 10:32:25

From: Flight
This explains why I was having trouble with Simba 820 being able to compile R2.


Its a Simba version issue!

No need to fix it, but the most recent simba *should* be able to compile it just fine. Wizzup stated he fixed the include once issues.

Flight

2011-07-12 10:39:16

From: Nava2
Its a Simba version issue!

No need to fix it, but the most recent simba *should* be able to compile it just fine. Wizzup stated he fixed the include once issues.


Ah ok, then I'll look for and download the most recent.

Yago

2011-07-12 10:55:35

From: ggzz
repeat
R_DepositAllButEx([HouseTab, SickleB]);
until(R_ItemExists(FungusID, InvItem) = false);

Does not work.. Hooks are up to date. R_DepositAllBy(ID); Doesn't work either..


Could you describe what happens when you run it? I fixed an issue involving depositing items with the word "all" in them yesterday… Maybe this is it?

Brandon

2011-07-12 11:50:01

From: Yago
Could you describe what happens when you run it? I fixed an issue involving depositing items with the word "all" in them yesterday… Maybe this is it?


Well the code I had above does compile.. Its just I have three procedures: #1 checks for the items in the bank, #2 is that deposit function which checks the invent and deposits accordingly, # 3 Walks a path.

What happens is that # one fails to find the items in the bank so it goes straight to number two which fails to deposit and goes to number three which runs..

so it doesn't bank at all. it just opens the bank interface and starts running. I believe it might be an issue with either the hooks or with the interface values but my hooks are the latest so :S

Yago

2011-07-12 12:02:49

From: ggzz
Well the code I had above does compile.. Its just I have three procedures: #1 checks for the items in the bank, #2 is that deposit function which checks the invent and deposits accordingly, # 3 Walks a path.

What happens is that # one fails to find the items in the bank so it goes straight to number two which fails to deposit and goes to number three which runs..

so it doesn't bank at all. it just opens the bank interface and starts running. I believe it might be an issue with either the hooks or with the interface values but my hooks are the latest so :S


So lets fix 1 and 2 then… Try going on irc. Ill be on in a min.

pyroryan

2011-07-12 14:35:39

RS updated at about 10:26AM EST. Hooks were updated at 11:42AM EST.
I'll be checking up on the bank stuff.

Edit:
Bank interface ids seems fine.

Drakan

2011-07-13 22:27:57

Thanks to everyone who helped contribute while I was gone! I will be back until the 20th, and then I'm gone again until the 30th. If you have any more bug reports or ideas to submit let me know before the 20th so we can get them in and rolling! Thanks everyone!

Jakkle

2011-07-14 11:32:36

As I have pointed out, trying to click the bankers in draynor is not working. If you could take a look at that I would be grateful :) Thanks.

Drakan

2011-07-14 11:43:36

Just tested it and it works fine.
R_FindNPC('Banker', false, NPC); 
That's what I used and it works.

mormonman

2011-07-14 20:33:22

What still needs work?

Drakan

2011-07-14 20:40:48

Randoms! If you could help with that it would be awesome! They are easy to port from java bots too :D

bolshak25

2011-07-15 21:07:27

when i was testing wackos rc script, it got demon random and completed it properly, but it didnt handle the box. it just went on with the script. dont know if others have that issue or if its not dealt with yet. other than that, i love the walking not taking 70% of my cpu.

Yago

2011-07-15 21:50:44

When will this be ready for release?

I think the box is anothe rindividual srl funtion or procedure…

Drakan

2011-07-15 22:02:01

We haven't added box support yet, but I'm glad to hear that the demon solver worked!

Flight

2011-07-15 22:13:27

What about asking TRiLeZ, he seems to have almost all the randoms solved with his TriBot, we might ask if he'd mind R2 using his methods of solving them.

Drakan

2011-07-15 22:19:43

We have been using his actually ;p It's just the fact that I don't have time to do em all, so I could use a bit of help :D

mormonman

2011-07-16 03:52:42

Added certer and abyss. Needs testing.

Geo

2011-07-16 18:39:21

Just updated a soon to be released, currently private, script to use ref2. I'll babysit the script and post results on Randoms. Also, thanks to everyone who worked on reflection2 it looks great. :) And, I'm liking the failsafe added to R_WindWalk that R_WebWalk was lacking.

mormonman

2011-07-17 01:12:11

Forester done.
Randoms left: Frog, Molly, Pillory, Pinball, Prison, Quiz, Sandwich, and ScapeRune.

Will do some tomorrow.

Jakkle

2011-07-17 11:36:37

when going to log out it sometimes does not click the loggout button and takes a few tries to click it.

Drakan

2011-07-17 11:39:08

That's your friends at srl bud, not reflection :p

Jakkle

2011-07-17 11:41:29

From: drags111
That's your friends at srl bud, not reflection :p


Oh yeah :duh: lol well i will post it there then sorry :o.

Home

2011-07-17 11:46:35

I have some Odd problem.

I'm using R_WindWalk to walk Essesnce Rocks.

First I calculate nearest Essence Mine. Then walk to it..

Well sometimes it just keeps clicking way off. Even the tile where it is supposed to go is like 2 tiles away. I even Debug them. And still it walks way off. Sometimes works nicely.. Sometimes not. :S


~Home

Drakan

2011-07-17 11:48:51

From: Home
I have some Odd problem.

I'm using R_WindWalk to walk Essesnce Rocks.

First I calculate nearest Essence Mine. Then walk to it..

Well sometimes it just keeps clicking way off. Even the tile where it is supposed to go is like 2 tiles away. I even Debug them. And still it walks way off. Sometimes works nicely.. Sometimes not. :S


~Home


I've never been a huge fan of WindWalk and frankly havn't looked into it much. However I believe that if the destination tile is on the minimap then using WindWalk isn't suggested. Try using sums and differences to "hard-code" the paths, as iirc the tiles are dynamic now?

Jakkle

2011-07-17 11:51:20

I seen that when R_WindWalk has clicked like 20 or more times to get to a point it says [R_WebWalk] could not find the point after 20 tries. Well something along them lines. What I'm pointing out is only small but the fact it says webwalk :p

Home

2011-07-17 11:52:32

From: drags111
I've never been a huge fan of WindWalk and frankly havn't looked into it much. However I believe that if the destination tile is on the minimap then using WindWalk isn't suggested. Try using sums and differences to "hard-code" the paths, as iirc the tiles are dynamic now?


Yes the tiles are Dynamic now.. I would do Hard coded paths.. But it's impossible? If you have anyideas, please tell. Thanks.

Or other suggestions?

EDIT: Ok.. I can't use R_WindWalk. It fails way too much and get's you banned.
Damn it..

~Home

Jakkle

2011-07-17 12:01:00

We really need a good webwalk, did you say there is 1 in the making for ref 2 drags ?

Drakan

2011-07-17 12:25:23

From: Home
Yes the tiles are Dynamic now.. I would do Hard coded paths.. But it's impossible? If you have anyideas, please tell. Thanks.

Or other suggestions?

EDIT: Ok.. I can't use R_WindWalk. It fails way too much and get's you banned.
Damn it..

~Home


I told you how. Use additions and subtractions to make the paths. Find an object thats always in the same place in the center part. Get it's tile and you know that the closest spot is X amount of tiles to the left and Y amount of tiles up. It's really easy.

Home

2011-07-17 12:54:18

From: drags111
I told you how. Use additions and subtractions to make the paths. Find an object thats always in the same place in the center part. Get it's tile and you know that the closest spot is X amount of tiles to the left and Y amount of tiles up. It's really easy.


Yeah stupid me. Got it solved :P


~Home

Drakan

2011-07-17 13:02:09

:) good! Let me know if you need anything else!

Home

2011-07-17 14:49:47

Ok guys. One bug that i'v noticed:

Getting Tile from object.

If you are too near of Big object? It will Result -1, -1.


~Home

Flight

2011-07-17 21:59:17

I've decided just not to use Objects at all. If I know the static location of an object, I'll use a predefined tile rather than searching for the object, and if the object is dynamic, I'll use PoW's TPA color finder, which works very fast and very accurately.

Drakan

2011-07-17 22:24:23

From: Home
Ok guys. One bug that i'v noticed:

Getting Tile from object.

If you are too near of Big object? It will Result -1, -1.


~Home


That shouldn't be the case. That's how I test objects is stand right next to them. How are you going about searching for the object? Paste some code.

@Flight: Lol. For the last time objects are not dynamic. And they won't be. Using predetermined tiles is fine, but gl using predetermined tiles to check if the tree is chopped or rock is mined.

Flight

2011-07-17 22:38:24

I just recently made a post telling how they are… If objects aren't dynamic, then would would you call an object that changes in both ID and Tile? I'm sorry if my understanding of dynamic is wrong, but I wouldn't call that "static".

Drakan

2011-07-17 22:40:11

What object in runescape changes id and tile?

Flight

2011-07-17 22:45:07

Every interactable object on the outside ring of the Abyss, both the soil and Livid's in Livid Farm, the Mutated and Jade vines within the Jadinko Lair. I wouldn't be surprised if you didn't know about this because these are fairly new releases and the majority of the people here will never use these places. I just wonder why they would go back and apply the changes to the Abyss.

Drakan

2011-07-17 22:50:54

Ok but read my post in the other thread. Those are Instances. They can do that in them, not in the regular world. So your rational of never using object finding because dynamic objects exist inside instances is kinda silly.

Home

2011-07-18 05:22:15

Drags:

Some code:

  GEssence := NULL_RSOBJECT; // Clear.
GEssence := R_GetObject(ESSENCE_ID, OBJ_INTERACTABLE, 50);
Result := GEssence <> NULL_RSOBJECT;

Sometimes works. Sometimes not.

~Home

Drakan

2011-07-18 10:52:50

From: Home
Drags:

Some code:

  GEssence := NULL_RSOBJECT; // Clear.
GEssence := R_GetObject(ESSENCE_ID, OBJ_INTERACTABLE, 50);
Result := GEssence <> NULL_RSOBJECT;

Sometimes works. Sometimes not.

~Home


Weird. Btw you don't need to set clear the object before hand as ref2 does it automatically. Don't think that would make a difference, I'm just saying. Are you standing right next to it or what?

Home

2011-07-18 11:31:03

From: drags111
Weird. Btw you don't need to set clear the object before hand as ref2 does it automatically. Don't think that would make a difference, I'm just saying. Are you standing right next to it or what?


That might make a difference I must try that :)

And yes I stand next to it.

~Home

Brandon

2011-07-18 13:44:20

Your problem… Happened to me while making my fungus script.. What happens is that since the distance is so large, if your character is within distance from another object with the same ID, it will not know which one to click because its finding two objects and trying to store the info in TRSObject.. instead of TRSObjectArray.

What you really need to do is find all objects with the ID.. so R_GetObjects <– notice the "s".. Then you sort those objects by distance from you.. you then store that in a TRSObjectArray and go to Object[0] which should be the closest Object to you (Tom helped me realize that).. One problem I still came across, although VERY RARE, is that if you are exactly in the dead centre of two objects, sort object will fail!!! So if you can figure that out then share.


//Sorts Objects By Distance From Me..
//Objects = Multiple Objects To Sort.

function R_SortObjects(Objects: TRSOBJECTARRAY): TRSOBJECTARRAY;
var
i,i2, L: integer;
tpa: TPointArray;
Obj: TRSOBJECT;
begin
L := Length(Objects);
if L < 1 then Exit;
SetLength(TPA, L);
SetLength(Result, L);
for i := 0 to L-1 do
TPA[i] := Objects[i].Tile;
SortTPAFrom(TPA, Obj.Tile);
for i := 0 to L-1 do
for i2 := 0 to L-1 do
if (TPA[i].x=Objects[i2].Tile.x) and (TPA[i].y=Objects[i2].Tile.y) then
Result[i] := Objects[i2];
end;

EssenceObj, EssMine: TRSOBJECTARRAY;
StoreObj: TRSObject;
EssenceID: Integer; //Can be a constant aswell..

EssenceObj:= R_GetObjects(EssenceID, 2, 52);
if(Not R_FindObjects(EssenceID, 2, 52, EssenceObj)) then
Repeat
wait(RandomRange(500, 1000));
R_FindObject(EssenceID, 2, 52, EssenceObj);
LoginCheck;
Until(R_FindObject(EssenceID, 2, 52, EssenceObj));

//Sort Objects
EssMine:= R_SortObjects(EssenceObj);
R_WalkToTile(EssMine[0].Tile, 0, 1);
wait(2000);
StoreObj:= EssMine[0]; //Stores the closest object so it can be used later..

Home

2011-07-18 13:54:49

From: ggzz
Your problem… Happened to me while making my fungus script.. What happens is that since the distance is so large, if your character is within distance from another object with the same ID, it will not know which one to click because its finding two objects and trying to store the info in TRSObject.. instead of TRSObjectArray.

What you really need to do is find all objects with the ID.. so R_GetObjects <– notice the "s".. Then you sort those objects by distance from you.. you then store that in a TRSObjectArray and go to Object[0] which should be the closest Object to you (Tom helped me realize that).. One problem I still came across, although VERY RARE, is that if you are exactly in the dead centre of two objects, sort object will fail!!! So if you can figure that out then share.


//Sorts Objects By Distance From Me..
//Objects = Multiple Objects To Sort.

function R_SortObjects(Objects: TRSOBJECTARRAY): TRSOBJECTARRAY;
var
i,i2, L: integer;
tpa: TPointArray;
Obj: TRSOBJECT;
begin
L := Length(Objects);
if L < 1 then Exit;
SetLength(TPA, L);
SetLength(Result, L);
for i := 0 to L-1 do
TPA[i] := Objects[i].Tile;
SortTPAFrom(TPA, Obj.Tile);
for i := 0 to L-1 do
for i2 := 0 to L-1 do
if (TPA[i].x=Objects[i2].Tile.x) and (TPA[i].y=Objects[i2].Tile.y) then
Result[i] := Objects[i2];
end;

EssenceObj, EssMine: TRSOBJECTARRAY;
StoreObj: TRSObject;
EssenceID: Integer; //Can be a constant aswell..

EssenceObj:= R_GetObjects(EssenceID, 2, 52);
if(Not R_FindObjects(EssenceID, 2, 52, EssenceObj)) then
Repeat
wait(RandomRange(500, 1000));
R_FindObject(EssenceID, 2, 52, EssenceObj);
LoginCheck;
Until(R_FindObject(EssenceID, 2, 52, EssenceObj));

//Sort Objects
EssMine:= R_SortObjects(EssenceObj);
R_WalkToTile(EssMine[0].Tile, 0, 1);
wait(2000);
StoreObj:= EssMine[0]; //Stores the closest object so it can be used later..


Thanks mate!

I Will update those tomorrow.
(Will speed speed up my Essence Miner a bit :))

EDIT: Drags and fellows. Can you look this issue up :)

~Home

Drakan

2011-07-18 18:00:12

Yah when I get some time later tonight! Going to the gym now. Just a little update from me: I've been messing around with titan a bit just for funsies and seeing what we can do with it. It has class support which is turning out to be an amazingly useful feature. Been working all morning, but I just got dynamic NPC tracking done with it. AKA you don't have to FindNPC every time, you just do NPC.GetTile and it will get the latest tile. Same with HPRatio. It will dynamically load these values from the object to make it possible to track them! Great news for autofighters =]

Yago

2011-07-18 19:16:07

From: drags111
Yah when I get some time later tonight! Going to the gym now. Just a little update from me: I've been messing around with titan a bit just for funsies and seeing what we can do with it. It has class support which is turning out to be an amazingly useful feature. Been working all morning, but I just got dynamic NPC tracking done with it. AKA you don't have to FindNPC every time, you just do NPC.GetTile and it will get the latest tile. Same with HPRatio. It will dynamically load these values from the object to make it possible to track them! Great news for autofighters =]


OMG OMG I want!!!!

Brandon

2011-07-18 20:02:42

I need to know how to find which object is blocking me from getting to another object or area.. :c Having the hardest time doing that.. I'm using R_CanReach atm but its still difficult because it doesn't return which object is blocking me (if there is one)..

Gu3st...

2011-07-18 20:04:45

From: drags111
Yah when I get some time later tonight! Going to the gym now. Just a little update from me: I've been messing around with titan a bit just for funsies and seeing what we can do with it. It has class support which is turning out to be an amazingly useful feature. Been working all morning, but I just got dynamic NPC tracking done with it. AKA you don't have to FindNPC every time, you just do NPC.GetTile and it will get the latest tile. Same with HPRatio. It will dynamically load these values from the object to make it possible to track them! Great news for autofighters =]
But that's only titan, or would that work with simba too?

masterBB

2011-07-18 20:10:04

From: drags111
Yah when I get some time later tonight! Going to the gym now. Just a little update from me: I've been messing around with titan a bit just for funsies and seeing what we can do with it. It has class support which is turning out to be an amazingly useful feature. Been working all morning, but I just got dynamic NPC tracking done with it. AKA you don't have to FindNPC every time, you just do NPC.GetTile and it will get the latest tile. Same with HPRatio. It will dynamically load these values from the object to make it possible to track them! Great news for autofighters =]


What hook did you use to keep track of the NPC? Or don't you free the npc node but keep it in memory of the class?

mormonman

2011-07-18 20:36:51

From: masterBB
What hook did you use to keep track of the NPC? Or don't you free the npc node but keep it in memory of the class?


You just don't destroy the class.

Drakan

2011-07-18 22:35:58

Not for simba unless it adapts classes. It's too much of a hassle w/o them in simba.

Nava2

2011-07-19 00:39:05

From: drags111
Not for simba unless it adapts classes. It's too much of a hassle w/o them in simba.


Not really, you just maintain the NPC index and then you could easily do it with wrappers. Its really not that much different. I used to do it in my Abyssal Crafter for the Zammy Mage. :/

Drakan

2011-07-19 00:41:11

From: Nava2
Not really, you just maintain the NPC index and then you could easily do it with wrappers. Its really not that much different. I used to do it in my Abyssal Crafter for the Zammy Mage. :/


NPC Index changes frequently now. At least according to mine and mormonmans testing.

Nava2

2011-07-19 00:55:08

From: drags111
NPC Index changes frequently now. At least according to mine and mormonmans testing.


Then how are you doing it in Titan? It will be possible, I promise ;). Dont give up on linear programming. The world runs on C still. :)

mormonman

2011-07-19 01:20:05

From: Nava2
Then how are you doing it in Titan? It will be possible, I promise ;). Dont give up on linear programming. The world runs on C still. :)


You have to go through the npc node with that index. It's a huge hassle for a small reward ;)

Drakan

2011-07-19 01:43:30

From: mormonman
You have to go through the npc node with that index. It's a huge hassle for a small reward ;)


Actually simpler than that. To track it you just don't free the smart object until the class is freed, then an override destroy method is called, checks the Object Reference, checks smart to see if it needs to be freed, and does accordingly. In Titan I have accessor functions for everything. The things that are dynamic (tiles, orientations, etc) are loaded from the object, and the rest if loaded from stored variables.

As mormonman said, huge hassle for a small reward.

On a side note, to check if the NPC is no longer in existance, yes you have to go through the nodecache and compare objects with SmartIsEqual.

Echo_

2011-07-20 12:19:31

Sent a pull request over for the Sandwich Lady solver ;)

KingKong

2011-07-21 20:33:52

From: drags111
Not for simba unless it adapts classes. It's too much of a hassle w/o them in simba.


Isn't it possible to use a plugin for what you're doing, so that in can work in simba? (P.S. I don't know much about plugins)

Mr. Freeweed

2011-07-21 23:07:09

I havn't messed with scar/simba in years and I just want to say you guys are doing a fantastic job. I have been going through the code and have been updating a few of my scripts the last few days.

Cheers

mormonman

2011-07-21 23:34:55

From: KingKong
Isn't it possible to use a plugin for what you're doing, so that in can work in simba? (P.S. I don't know much about plugins)


PS != paxCompiler

Nava2

2011-07-22 11:20:45

From: mormonman
PS != paxCompiler


No, but I think PS will allow one to import classes.

mormonman

2011-07-23 00:35:26

From: Nava2
No, but I think PS will allow one to import classes.


RemObjects actually allows importing classes, but titan handles stuff so much faster…

Coh3n

2011-07-23 10:56:43

Surely there's a FOSS paxCompiler alternative somewhere that can be used, no?

Wizzup?

2011-07-23 11:30:14

There are so many misinterpretations around OOP programming around here it makes me sad.

Without inheritance OOP offers _no_ advantage over non-OOP programming. Heck, most of the world manages _just_ _fine_ without any OOP. You only need OOP when you're doing serious inheritance, that's the only real advantage of OOP and it's something we've never really needed and we don't really need it now either. paxCompiler will *never* be faster than a Free Pascal plugin, so if you want stuff done fast, write it in a plugin. Sure, pascal script is slower and it sucks, but it's more than enough for the tasks you're trying to do. Heck, it worked for the past five (or more…) years; and it still works fine now. Sure, improvements would be nice, but in the form of DWS or lape.

Nava2

2011-07-23 11:36:40

From: Wizzup?
There are so many misinterpretations around OOP programming around here it makes me sad.

Without inheritance OOP offers _no_ advantage over non-OOP programming. Heck, most of the world manages _just_ _fine_ without any OOP. You only need OOP when you're doing serious inheritance, that's the only real advantage of OOP and it's something we've never really needed and we don't really need it now either. paxCompiler will *never* be faster than a Free Pascal plugin, so if you want stuff done fast, write it in a plugin. Sure, pascal script is slower and it sucks, but it's more than enough for the tasks you're trying to do. Heck, it worked for the past five (or more…) years; and it still works fine now. Sure, improvements would be nice, but in the form of DWS or lape.


This is what I have been trying to get across, as well.

If moromonman/Drags could post their OOP version of NPCs I am willing to bet I could write a non-OOP version that works just fine.

mormonman

2011-07-23 14:19:56

From: Nava2
This is what I have been trying to get across, as well.

If moromonman/Drags could post their OOP version of NPCs I am willing to bet I could write a non-OOP version that works just fine.


I believe all you have to do is leave the object unfreed.

Wizzup?

2011-07-23 14:28:31

From: mormonman
I believe all you have to do is leave the object unfreed.


What do you mean? I can't make sense of this in the current context. OOP doesn't imply memory management.

mormonman

2011-07-23 14:49:09

From: Wizzup?
What do you mean? I can't make sense of this in the current context. OOP doesn't imply memory management.


To continue to use NPC.getTile you have to leave the NPC object loaded in smart. Otherwise you have to do what we currently do and just re-run the GetNPC function or other NPC locating functions.

Wizzup?

2011-07-23 14:49:51

From: mormonman
To continue to use NPC.getTile you have to leave the NPC object loaded in smart. Otherwise you have to do what we currently do and just re-run the GetNPC function or other NPC locating functions.


I do not see how this relates to OOP at all. Can you be more clear?

mormonman

2011-07-23 14:56:15

From: Wizzup?
I do not see how this relates to OOP at all. Can you be more clear?


OOP gave us a framework for leaving a class created until we want to destroy it. I'm sure we could do it without OOP, but our last attempt at creating wrappers, etc made reflection even slower.

Wizzup?

2011-07-23 16:00:12

From: mormonman
OOP gave us a framework for leaving a class created until we want to destroy it. I'm sure we could do it without OOP, but our last attempt at creating wrappers, etc made reflection even slower.


Unless you're actually coding in Java you're still writing wrappers. With OOP, how do you not destroy a class? Isn't it just a matter of keeping track of the record? If you can show me the OOP code I'm sure we can make a non-OOP version of it.

Nava2

2011-07-23 22:17:16

From: Wizzup?
Unless you're actually coding in Java you're still writing wrappers. With OOP, how do you not destroy a class? Isn't it just a matter of keeping track of the record? If you can show me the OOP code I'm sure we can make a non-OOP version of it.


Basically, all you have to do is maintain the NPC Object ID from smart, then use that to re-get the values. The reason they used OOP is because instead of an index they used the value.

WOW. This is stupid easy to implement.

Just write a function to create a TNPC from the ID.. not hard. The wrappers are slow, but for what you're using it for you could *easily* do it and not get *all* of the parts of the object.

mormonman

2011-07-24 03:35:56

I know this is weird, but why are you guys so against OOP?

Wizzup?

2011-07-24 05:21:47

From: mormonman
I know this is weird, but why are you guys so against OOP?


I can only speak for myself, but I'm not _against_ OOP, it can be a very convenient way of programming. Saying however that Simba is not suitable for running some code because it _must_ be OOP when it doesn't have to be OOP is what I oppose to.

OOP has lots of advantages as well, and it often results in more readable code, and I hope lape will get it at some point, but it's certainly not a requirement to be able to write your current code for Simba.

If you want to write very fast, nice and clean code, write it in a plugin and export it as a class to PS. That way it will be fast and you'll have a very mature compiler. (Free Pascal)

mormonman

2011-07-24 05:39:45

The readability of Drags' implementation of OOP is just so much easier than writing a complete reflection include as a plugin. I have nothing against simba and I have never said that Simba is not suitable for what we are doing, I just said it's a lot bigger hassle. Lape looks awesome, I hope niels finishes it soon.

I don't understand all this arguing either ;)

Wizkid

2011-07-24 11:28:50

I have no idea where to post this, but reflection 2 didn't detect the pinball random :(

~ Wizkid

Awkwardsaw

2011-07-24 11:39:52

I too don't know where to post this, but i've encountered a bug when converting my mta script to ref2.


function getwalls : integer; //ref1
var
walls : TRSObjectArray;
begin
writeln('Getting maze walls, may take a little bit');
walls := GetObjectsByID(wall_id, 1, 35);
result := length(walls);
end;

function getwalls : integer; //ref 2
var
walls : TRSObjectArray;
begin
writeln('Getting maze walls, may take a little bit');
walls := r_GetObjects(wall_id, OBJ_WALLOBJECT, 35);
result := length(walls);
end;

r_GetObjects returns a huge amount of objects(in the 600's range) in all the mazes i try, where the one for ref1 works exactly how it should. just thought i would bring it up :)

Smarter Child

2011-07-24 12:17:58

Set the MaxDist to a lower number?

Awkwardsaw

2011-07-24 12:30:33

From: Smarter Child
Set the MaxDist to a lower number?


It has to be 35. :p

Like i said, it works how it's suposed to on ref1, but not ref 2

Jakkle

2011-07-30 21:05:05

Could you please change R_FindGroundItem to search the chars position for the item before looking to see which item is the nearest :D Thanks
-Jakkle-

Echo_

2011-07-31 08:51:01

From: Jakkle
Could you please change R_FindGroundItem to search the chars position for the item before looking to see which item is the nearest :D Thanks
-Jakkle-


Wouldn't that be an issue with R_SortedCircleTPA? There should probably be a boolean parameter to see if the user wants to include the center with the resulting TPA.

Jakkle

2011-07-31 11:02:32

Tiles := R_SortedCircleTPA(R_GetMyPos, MaxDist);
You on about this ?
I had a quick look through the ground item functions and that is the only bit I found to do with that.
Edit: I was thinking that it is only using from my tile to high tile and not including my tile.

Brandon

2011-08-01 00:01:20

Am I doing it right? I want to click Objects/Models:


Vertex_x := SmartGetFieldInt(SecondLevel, hook_sdmodel_GetIndices1);
Vertex_y := SmartGetFieldInt(SecondLevel, hook_sdmodel_GetIndices2);
Vertex_z := SmartGetFieldInt(SecondLevel, hook_sdmodel_GetIndices3);
Indices1 := SmartGetFieldShort(SecondLevel, hook_sdmodel_GetPointsX);
Indices2 := SmartGetFieldShort(SecondLevel, hook_sdmodel_GetPointsY);
Indices3 := SmartGetFieldShort(SecondLevel, hook_sdmodel_GetPointsZ);

Vertices := Min(Length(vertex_x), Min(Length(vertex_y), Length(vertex_z)));
Faces := Min(Length(Indices1), Min(Length(Indices2), Length(Indices3)));

mormonman

2011-08-01 00:05:27

From: ggzz
Am I doing it right? I want to click Objects/Models:


Vertex_x := SmartGetFieldInt(SecondLevel, hook_sdmodel_GetIndices1);
Vertex_y := SmartGetFieldInt(SecondLevel, hook_sdmodel_GetIndices2);
Vertex_z := SmartGetFieldInt(SecondLevel, hook_sdmodel_GetIndices3);
Indices1 := SmartGetFieldShort(SecondLevel, hook_sdmodel_GetPointsX);
Indices2 := SmartGetFieldShort(SecondLevel, hook_sdmodel_GetPointsY);
Indices3 := SmartGetFieldShort(SecondLevel, hook_sdmodel_GetPointsZ);

Vertices := Min(Length(vertex_x), Min(Length(vertex_y), Length(vertex_z)));
Faces := Min(Length(Indices1), Min(Length(Indices2), Length(Indices3)));


No.

Flight

2011-08-01 00:16:57

Clicking an actual Object/Model would be nice. I think Iamadam can help us out with that.

mormonman

2011-08-01 00:23:41

From: Flight
Clicking an actual Object/Model would be nice. I think Iamadam can help us out with that.


At the current speed of simba this just isn't logical.

Brandon

2011-08-01 00:43:00

From: mormonman
At the current speed of simba this just isn't logical.


Elaborate on that.. Why is it not logical? I mean u only click an object when its on screen.. so the speed won't really matter because U would only search for an object near the character and try to click it. It's just all the other bots have these basic functions that a scripter needs.. and we don't :c I thought it was taking way too long (we've been saying we'd have model clicking for months now) so I tried to do it but I guess It's wrong :c

Oh and TileArea doesn't work for WallObjects such as doors.. it will never get the tilearea for me :c I can get the object tile.. but the area doesn't return a value so Iunno and my hooks are updated cuz I just checked it.

mormonman

2011-08-01 01:29:08

From: ggzz
Elaborate on that.. Why is it not logical? I mean u only click an object when its on screen.. so the speed won't really matter because U would only search for an object near the character and try to click it. It's just all the other bots have these basic functions that a scripter needs.. and we don't :c I thought it was taking way too long (we've been saying we'd have model clicking for months now) so I tried to do it but I guess It's wrong :c

Oh and TileArea doesn't work for WallObjects such as doors.. it will never get the tilearea for me :c I can get the object tile.. but the area doesn't return a value so Iunno and my hooks are updated cuz I just checked it.


WallObjects don't have tile areas. Speed does matter.

Jakkle

2011-08-01 05:15:31

Mormonman, with the function R_FindGroundItem is it set to search the tile the char is standing on ?

Drakan

2011-08-01 09:20:36

From: ggzz
Elaborate on that.. Why is it not logical? I mean u only click an object when its on screen.. so the speed won't really matter because U would only search for an object near the character and try to click it. It's just all the other bots have these basic functions that a scripter needs.. and we don't :c I thought it was taking way too long (we've been saying we'd have model clicking for months now) so I tried to do it but I guess It's wrong :c

Oh and TileArea doesn't work for WallObjects such as doors.. it will never get the tilearea for me :c I can get the object tile.. but the area doesn't return a value so Iunno and my hooks are updated cuz I just checked it.


I also said as soon as reflection 2 is RELEASED (eg not in Beta but full) then I will begin development on model clicking. Seeing as reflection 2 is not released yet, I don't wanna bother with models quite yet. Also yes, the speed of free pascal is too slow to make model clicking efficient (because of calculating all the points etc) but can be done with plugins. However, waiting for LAPE would be more logical, I just don't know how long we will be waiting.

Echo_

2011-08-01 09:27:48

From: Jakkle
Tiles := R_SortedCircleTPA(R_GetMyPos, MaxDist);
You on about this ?
I had a quick look through the ground item functions and that is the only bit I found to do with that.
Edit: I was thinking that it is only using from my tile to high tile and not including my tile.


Yes, R_FindGroundItem uses R_GetGroundItemEx, and R_GetGroundItemEx uses R_SortedCircleTPA. Rather than trying to edit the first two procedures, it would be easier to edit R_SortedCircleTPA to include the point from which it is radiating from.

Jakkle

2011-08-01 14:04:07

From: Echo_
Yes, R_FindGroundItem uses R_GetGroundItemEx, and R_GetGroundItemEx uses R_SortedCircleTPA. Rather than trying to edit the first two procedures, it would be easier to edit R_SortedCircleTPA to include the point from which it is radiating from.


Ok I will have a look and see what I can do myself.
Thanks alot :)

Edit1: found what was wrong very simple fix if you wouldn't mind :p
Change to this please.

(*
R_GetObjectAt {R_SortedCircleTPA}
~~~~~~~~~~~~~

.. code-block:: pascal

function R_SortedCircleTPA(Center: TPoint; Radius: Integer): TPointArray;

Returns an array of all TPoints inside the circle. Sorted from closest to the
Center.

.. note::

by Wizzup and BenLand100

*)
function R_SortedCircleTPA(Center: TPoint; Radius: Integer): TPointArray;
begin
SetLength(Result,0);
Result := TPAFromBox(IntToBox(Center.X - Radius, Center.Y - Radius, Center.X + Radius, Center.Y + Radius));
FilterPointsPie(Result, 0, 360, -1, Radius, Center.X, Center.Y);
SortTPAFrom(Result, Center);
end;
Edit2: also it says R_GetObjectAt in the documented bit

mormonman

2011-08-01 14:33:36

Done, thanks!

Jakkle

2011-08-01 14:45:02

Your welcome happy to help :)

Brandon

2011-08-01 14:54:47

From: drags111
I also said as soon as reflection 2 is RELEASED (eg not in Beta but full) then I will begin development on model clicking. Seeing as reflection 2 is not released yet, I don't wanna bother with models quite yet. Also yes, the speed of free pascal is too slow to make model clicking efficient (because of calculating all the points etc) but can be done with plugins. However, waiting for LAPE would be more logical, I just don't know how long we will be waiting.



We'd be waiting forever.. Is anything much changing in the full release of ref2 compared to the beta? Like huge changes? If I knew how to hook the model class I'd do this myself and when ref2 full comes out I'd adapt it.. but there aren't any tutorials on how to use smartgetfield/object, etc.. Lape will make that much of a speed difference? I would wait but like everything else around here, I'd be waiting months so I'd rather get something done myself but I can't :c

mormonman

2011-08-01 15:27:17

From: ggzz
We'd be waiting forever.. Is anything much changing in the full release of ref2 compared to the beta? Like huge changes? If I knew how to hook the model class I'd do this myself and when ref2 full comes out I'd adapt it.. but there aren't any tutorials on how to use smartgetfield/object, etc.. Lape will make that much of a speed difference? I would wait but like everything else around here, I'd be waiting months so I'd rather get something done myself but I can't :c


Well for one thing, all of the anti-randoms will be working. We are still ironing out little bugs too, such as the sortedcircletpa issue.

Drakan

2011-08-01 15:53:13

It's not even about learning to use SMART, you need a knowledge of the client and how everything works, as well as some basic java skills. It's not like I can really do anything right now seeing as I'm on vacation, so drop the attitude. If you wanna get something done then help with everything else that needs to be worked on (aka randoms) or learn about the runescape client.

Brandon

2011-08-01 16:02:34

From: drags111
It's not even about learning to use SMART, you need a knowledge of the client and how everything works, as well as some basic java skills. It's not like I can really do anything right now seeing as I'm on vacation, so drop the attitude. If you wanna get something done then help with everything else that needs to be worked on (aka randoms) or learn about the runescape client.


Uhh No attitude in my post :S I only asked what was left.. and mentioned that there are no tutorials on how to use smartfield stuff.. As for saying I'd be waiting forever is only how I think and what I see thats all. I didn't ask for u to do it either I was asking if Lape will make that much of a difference in speed than what we have now. As for learning about the client, never knew I had to do that to use smartgetfield. As for randoms, I don't have any accounts in randoms and I only have 2 accounts total so.. thats off the list.

Wizzup?

2011-08-01 16:08:16

From: drags111
I also said as soon as reflection 2 is RELEASED (eg not in Beta but full) then I will begin development on model clicking. Seeing as reflection 2 is not released yet, I don't wanna bother with models quite yet. Also yes, the speed of free pascal is too slow to make model clicking efficient (because of calculating all the points etc) but can be done with plugins. However, waiting for LAPE would be more logical, I just don't know how long we will be waiting.


You mean Pascalscript, I assume. Plugins are written in Free Pascal. :)

Echo_

2011-08-01 17:42:19

From: ggzz
but there aren't any tutorials on how to use smartgetfield/object, etc..


You didn't look hard enough.

http://villavu.com/forum/showthread.php?t=64388

Bixby Sayz

2011-08-01 22:48:27

Is there a topic/subforum where we can post reflection 2 bugs/ask if behavior is a bug?

I'm curious if it is a designed "feature" that R_GetGroundItemEx and R_GetGroundItemsEx fail to find items on the same tile as your player. Means you have to make 2 checks: check your tile then check around you.

Edit: R_GetAllGroundItems also has this "feature." Under your feet is not found. 1 or more spaces away no problem.

Drakan

2011-08-02 00:29:45

From: Wizzup?
You mean Pascalscript, I assume. Plugins are written in Free Pascal. :)


Well i was referring to the fact that it's a little too messy to use plugins for models since you have to retrieve the hook info from SMART and you can't really do that in a plugin, so I'm waiting for LAPE where I wont have to use plugins to get good speed :P

@ ggzz: nAnd it just seemed like you were bashing us saying that we don't get anything done and the only way for any progress to be made is to do it yourself. Gave the impression of an attitude…

Drakan

2011-08-02 00:31:17

From: Bixby Sayz
Is there a topic/subforum where we can post reflection 2 bugs/ask if behavior is a bug?

I'm curious if it is a designed "feature" that R_GetGroundItemEx and R_GetGroundItemsEx fail to find items on the same tile as your player. Means you have to make 2 checks: check your tile then check around you.

Edit: R_GetAllGroundItems also has this "feature." Under your feet is not found. 1 or more spaces away no problem.


I believe if you look ~7 posts up or so they were just talking about the fix for this. Not sure if mormonman committed it yet.

mormonman

2011-08-02 01:09:31

From: Bixby Sayz
Is there a topic/subforum where we can post reflection 2 bugs/ask if behavior is a bug?

I'm curious if it is a designed "feature" that R_GetGroundItemEx and R_GetGroundItemsEx fail to find items on the same tile as your player. Means you have to make 2 checks: check your tile then check around you.

Edit: R_GetAllGroundItems also has this "feature." Under your feet is not found. 1 or more spaces away no problem.


It's the same fix as objects/npcs on your tile. I fixed it already.

Bixby Sayz

2011-08-02 19:57:51

From: drags111
I believe if you look ~7 posts up or so they were just talking about the fix for this. Not sure if mormonman committed it yet.

My apologies. I skimmed through the topic and did a search but did not see that.

On another note did the Tile() function go away in Reflection 2? I can't seem to find it (and can't find any reference to it searching).

Drakan

2011-08-02 19:58:46

Yes it went away, just use Point()

masterBB

2011-08-02 20:16:45

From: Bixby Sayz
My apologies. I skimmed through the topic and did a search but did not see that.

On another note did the Tile() function go away in Reflection 2? I can't seem to find it (and can't find any reference to it searching).


As TTile equals TPoint, I'm sure you can also use Point(x,y).

edit: Didn't noticed the 10th page. Not sure if ninja'd or I'm just slow :P

Bixby Sayz

2011-08-02 20:33:11

From: masterBB
As TTile equals TPoint, I'm sure you can also use Point(x,y).

Yeah just having a brain fart.

Brandon

2011-08-02 22:25:01

I think there might have been a reason reflection 1 had TileToPoint function.. Why? Because I just tried making a script to click objects.. and when I make it click the "Tile", it doesn't work at all.. I use TileToMS to convert it to a point and it clicks it..

SmartClickMouse(Tile.x, Tile.y, true) doesn't work.. instead smart's mouse goes off to the black part at the very top left of the screen.. Whereas
SmartClickMouse(R_TileToMS(Tile, 0).x, R_TileToMS(Tile, 0).y, true) works perfectly.. and it clicks the object.

Not sure why but I was supposed to report that and forgot..

Drakan

2011-08-02 22:40:33

because you have to convert the tile to the ms coord first >.>…… And just use srl's Mouse function, no point in typing the extra letters..

var
P: TPoint;

P := TileToMS(Tile.X, Tile.Y, TheHeight);
Mouse(P.X, P.Y, RandomX, RandomY, True);

Brandon

2011-08-02 23:13:53

From: drags111
because you have to convert the tile to the ms coord first >.>…… And just use srl's Mouse function, no point in typing the extra letters..

var
P: TPoint;

P := TileToMS(Tile.X, Tile.Y, TheHeight);
Mouse(P.X, P.Y, RandomX, RandomY, True);


Can't use mouse.. sometimes it will use my actual mouse for whatever reason.. Thus why I take the extra time to use SmartMouse.. And wow.. thanks I didn't know about the converting thing.. I thought it was just a bug so I always did it that way for some reason.. LOL.

Drakan

2011-08-02 23:50:22

All TileToPoint did was convert from a TTile type to a TPoint type. Didn't actually give u on screen coords.

Jakkle

2011-08-04 08:55:46

You guys really need to get the randoms sorted out for R2, it is very very important to have fully working antirandoms otherwise people on here will start getting banned alot

Drakan

2011-08-04 09:37:20

From: Jakkle
You guys really need to get the randoms sorted out for R2, it is very very important to have fully working antirandoms otherwise people on here will start getting banned alot


bbeettttaa. It's on for testing purposes, not for the full dealio. But you're more than welcome to help with them ;)

Jakkle

2011-08-04 09:50:53

From: drags111
bbeettttaa. It's on for testing purposes, not for the full dealio. But you're more than welcome to help with them ;)


Yeah I know what your saying.
I'm going to look at all the randoms done and see how your coding them and try to have a go at doing 1 of the randoms not solved yet.

Home

2011-08-04 10:37:28

From: drags111
bbeettttaa. It's on for testing purposes, not for the full dealio. But you're more than welcome to help with them ;)


Drags. Those antirandoms, what kind of coding standards you would like to them be?


~Home

Drakan

2011-08-04 11:50:51

From: Home
Drags. Those antirandoms, what kind of coding standards you would like to them be?


~Home


Good ones? :P I'm afraid I don't understand what your asking. If you want to know the source of how we're solving them, I'm using Trilez's old open-source version of TriBot which has all the ones we need (except for Prison Pete). If you wanna help, let me know and I can send them to you.

mormonman

2011-08-04 13:36:29

Naming conventions for randoms are:
Functions and procedures all start with R*randomname*_ , this serves two purposes. To avoid newbies using intellisense and seeing all the functions used inside randoms and so that we can name them the same like RPrison_Exit, RSandwich_Exit.

Constants look like this: R*randomname*Const_*Name of Constant*

Global Variables like this: R*Randomname*Var_*Name of Variable*

The mainloop of the random should use a time-out. It should be able to start from anywhere in the random. That's all I can think of right now. Good luck!

mormonman

2011-08-05 05:18:01

3 RANDOMS LEFT!!! Molly, Prison, and ScapeRune.

Only one that I haven't even thought about is Prison…the other two I just need to sit down and do. They aren't very difficult.

Flight

2011-08-05 05:54:36

From: mormonman
3 RANDOMS LEFT!!! Molly, Prison, and ScapeRune.

Only one that I haven't even thought about is Prison…the other two I just need to sit down and do. They aren't very difficult.


You're doing wonderful, Mormonman! Keep it up mate. :spot:

Drakan

2011-08-05 09:03:51

From: Flight
You're doing wonderful, Mormonman! Keep it up mate. :spot:


Indeed you are doing great! Thanks for your hard work! :D Prison will only be solved if we get models in there I believe.

Flight

2011-08-05 11:21:04

From: drags111
Prison will only be solved if we get models in there I believe.


That's what I was thinking. Is this the hook we'd be using for that? "hook_npcdefloader_ModelRef"

Method

2011-08-05 14:06:29

From: drags111
Indeed you are doing great! Thanks for your hard work! :D Prison will only be solved if we get models in there I believe.


No, that's not necessary.

Jakkle

2011-08-05 18:02:47

From: mormonman
3 RANDOMS LEFT!!! Molly, Prison, and ScapeRune.

Only one that I haven't even thought about is Prison…the other two I just need to sit down and do. They aren't very difficult.


Grate job mormonman :thumbsup: Thanks so much for all your effort. I really do appreciate it :D

Home

2011-08-05 18:17:03

From: Method
No, that's not necessary.


It's not?

Care to explain :)


~Home

Method

2011-08-05 19:01:58

From: Home
It's not?

Care to explain :)


~Home


It's been explained multiple times already. The people who need to know already do, and the information is available for you to see at any time (provided you look for it).

Jakkle

2011-08-05 19:32:21

Freaky forester fix


const
RForestConst_MeatName = 'heasant';
RForestConst_PortalID = 15645;

var
RForestVars_NPC: TNPC;
RForestVars_OneTail, RForestVars_TwoTail,
RForestVars_ThreeTail, RForestVars_FourTail: TVariantArray;
RForestVars_DroppedItem: Boolean;
RForestVars_GroundItem: TGroundItem;
RForestVars_ItemName: String;

procedure RForest_SetVars;
begin
RForestVars_OneTail := [7445, 4277];
RForestVars_TwoTail := [7446, 13246];
RForestVars_ThreeTail := [13248, 13247];
RForestVars_FourTail := [13249, 13250];
RForestVars_DroppedItem := False;
RForestVars_GroundItem := NULL_GROUNDITEM;
RForestVars_ItemName := NULL_STRING;
end;

function RForest_InRandom: Boolean;
begin
Result := R_FindNPC('Freaky Forester', True, RForestVars_NPC);
if Result then
Result := PointInBox(R_GetMyPos, IntToBox(2593, 4767, 2611, 4781));
end;

function RForest_TalkTo: Boolean;
var
P: TPoint;
X, Y, T: Integer;
begin
Result := (Pos('Freaky Forester', R_GetNPCChatName) > 0);
if not R_FindNPC('Freaky Forester', True, RForestVars_NPC)then
begin
R_Debug('Unable to find Forester.', 'Forester');
Exit;
end;
if(R_DistanceFromTile(RForestVars_NPC.Tile) > 4)then
begin
if not R_WalkToTile(RForestVars_NPC.Tile, 1, 0)then
begin
R_Debug('Unable to walk to Forester.', 'Forester');
Exit;
end;
Wait(300+Random(50));
end;
P := R_TileToMS(RForestVars_NPC.Tile, RForestVars_NPC.Height/2);
MMouse(P.x, P.y, 3, 3);
wait(25+Random(25));
if not R_OptionExists('talk')then
Begin
GetMousePos(X, Y);
Mouse(P.x, P.Y, 0, 0, False);
if not R_ChooseOption('talk')then
Exit;
End;
if(R_DistanceFromTile(RForestVars_NPC.Tile) > 1)then
begin
R_WaitToMove(3000);
R_Flag;
end;
MarkTime(T);
while(TimeFromMark(T) < 3000)do
begin
if(R_ClickContinueExists)then
Break;
wait(50+Random(50));
end;
Result := (TimeFromMark(T) < 3000);
Wait(500);
end;

function RForest_GetType: TVariantArray;
var
NPCChat, Tails: String;
begin
while R_ClickContinueExists do
begin
NPCChat := R_GetNPCChatMessage;
if (Pos('can leave the area', NPCChat) > 0) then
begin
R_Debug('Pheasant already killed', 'Forester');
Result := [1, 1];
end;
if (Pos('Can you kill', NPCChat) > 0) then
begin
Tails := Trim(Between('Can you kill a ', '-tailed pheasant', NPCChat));
case Tails of
'one': Result := RForestVars_OneTail;
'two': Result := RForestVars_TwoTail;
'three': Result := RForestVars_ThreeTail;
'four': Result := RForestVars_FourTail;
End;
End;
if (Pos('Please kill', NPCChat) > 0) then
begin
Tails := Trim(Between('Please kill a pheasant that has ', ' tails', NPCChat));
case Tails of
'one': Result := RForestVars_OneTail;
'two': Result := RForestVars_TwoTail;
'three': Result := RForestVars_ThreeTail;
'four': Result := RForestVars_FourTail;
else
begin
R_Debug('Unable to parse tail amount', 'Forester');
Exit;
end;
end;
R_Debug('Hunting ' + Tails + '-tailed pheasant', 'Forester');
end;
R_ClickToContinue;
end;
end;

function RForest_DropItem: Boolean;
var
InvItem: TInvItem;
begin
Result := not R_InvFull;
if Result then
Exit;

InvItem := R_GetInvItemAt(28);
if not (InvItem = NULL_INVITEM) then
begin
R_DropItem(InvItem.Slot);
if R_ItemSlotExists(InvItem.Slot) then
begin
Result := False;
R_Debug('Failed to drop item', 'Forester');
Exit;
end;
with RForestVars_GroundItem do
begin
ID := InvItem.ID;
Stack := InvItem.StackSize;
Tile := R_GetMyPos;
end;
RForestVars_ItemName := 'Take ' + InvItem.Name;
end;
Result := not (RForestVars_GroundItem = NULL_GROUNDITEM);
RForestVars_DroppedItem := Result;
end;

function RForest_PickupDrop: Boolean;
var
Drop: TGroundItem;
P: TPoint;
begin
if not (RForestVars_GroundItem = NULL_GROUNDITEM) then
begin
if not R_TileOnMS(RForestVars_GroundItem.Tile, 50) then
begin
if not R_WalkToTile(RForestVars_GroundItem.Tile, 1, 0)then
begin
R_Debug('Unable to walk to dropped item', 'Forester');
Exit;
end;
Wait(300+Random(50));
end;
P := R_TileToMS(RForestVars_GroundItem.Tile, 50);
MMouse(P.x, P.y, 3, 3);
Wait(RandomRange(80, 120));
if R_OptionExists(RForestVars_ItemName) then
begin
GetMousePos(P.x, P.y);
Mouse(P.x, P.y, 0, 0, False);
if(R_ChooseOption(RForestVars_ItemName)) then
begin
R_Debug('Picking up dropped item', 'Forester');
R_WaitToMove(3000);
R_Flag;
Wait(500+Random(500));
end;
end;
end;

Result := not R_FindGroundItem(RForestVars_GroundItem.ID, 15, Drop);
end;

function RForest_KillPheasant(IDs: TVariantArray): Boolean;
var
Meat: TInvItem;
Pheasant: TNPC;
P: TPoint;
X, Y, T: Integer;
begin
if (Length(IDs) < 2) then
Exit;

if R_InvFull then
if not RForest_DropItem then
begin
R_Debug('Failed to drop item', 'Forester');
Exit;
end;

if not R_FindNPCMulti(IDs, True, Pheasant) then
begin
R_Debug('Unable to find Pheasant', 'Forester');
Exit;
end;

if(R_DistanceFromTile(Pheasant.Tile) > 4)then
begin
if not R_WalkToTile(Pheasant.Tile, 1, 0)then
begin
R_Debug('Unable to walk to Pheasant.', 'Forester');
Exit;
end;
Wait(300+Random(50));
end;
P := R_TileToMS(Pheasant.Tile, Pheasant.Height/2);
MMouse(P.x, P.y, 3, 3);
wait(25+Random(25));
if not R_OptionExists('attack')then
Exit;
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, False);
if not R_ChooseOption('attack')then
Exit;

MarkTime(T);
while(TimeFromMark(T) < 6000)do
begin
Result := R_ItemExists(RForestConst_MeatName, Meat);
if Result then
Break;
wait(50+Random(50));
end;
end;

function RForest_ReturnMeat: Boolean;
var
Meat: TInvItem;
begin
Result := not R_ItemExists(RForestConst_MeatName, Meat);
if Result then
begin
if RForestVars_DroppedItem then
if not RForest_PickupDrop then
begin
R_Debug('Unable to pick up dropped item', 'Forester');
Exit;
end;
Exit;
end;

if RForest_TalkTo then
while R_ClickContinueExists do
R_ClickToContinue;
Result := not R_ItemExists(RForestConst_MeatName, Meat);
if Result then
if RForestVars_DroppedItem then
if not RForest_PickupDrop then
begin
R_Debug('Unable to pick up dropped item', 'Forester');
Exit;
end;
end;

procedure RForest_Leave;
var
Portal: TRSObject;
P: TPoint;
X, Y, T: Integer;
begin
Portal := R_GetObject(RForestConst_PortalID, OBJ_INTERACTABLE, 15);
if(Portal = NULL_RSOBJECT)then
begin
R_Debug('Unable to find portal. Go buy Portal 2..', 'Forest');
Exit;
end;

if(R_DistanceFromTile(Portal.Tile) > 4)then
begin
if not R_WalkToTile(Portal.Tile, 1, 0)then
begin
R_Debug('Unable to walk to Portal.', 'Forest');
Exit;
end;
Wait(300+Random(50));
end;

P := R_TileToMS(Portal.Tile, 0);
MMouse(P.x, P.y, 10, 10);
wait(25+RandoM(25));
if not R_OptionExists('enter') then
Exit;

GetMousePos(X, Y);
Mouse(X, Y, 0, 0, false);
wait(25+RandoM(25));
if not R_ChooseOption('enter') then
Exit;

R_WaitToMove(3000);
R_Flag;

MarkTime(T);
while RForest_InRandom and (TimeFromMark(T) < 8000) do
Wait(500);
end;

function RForest_Solve: Boolean;
var
T: Integer;
PheasantIDs: TVariantArray;
KilledPheasant: Boolean;
begin
Result := False;
RForest_SetVars;

MarkTime(T);
while (RForest_InRandom and (TimeFromMark(T) < 300000)) do
begin
while ((not KilledPheasant) and (TimeFromMark(T) < 300000)) do
begin
if (Length(PheasantIDs) < 2) then
begin
if RForest_TalkTo then
PheasantIDs := RForest_GetType;
end else
begin
if PheasantIDs[1] = 1 then
KilledPheasant := True
else
KilledPheasant := RForest_KillPheasant(PheasantIDs);
end;
end;

if RForest_ReturnMeat then
RForest_Leave;

end;

Result := not RForest_InRandom;
R_ClickToContinue;
end;

Obviously needs further testing :p

Yago

2011-08-05 20:58:54

forester is working great for me…

Jakkle

2011-08-05 21:27:21

From: Yago
forester is working great for me…


did you use the 1 I posted or are you on about the 1 already in ref2 did it ?

ry0240

2011-08-05 21:30:45

Whats that one random called where your in a cage, and you have to click the shapes to "unlock" the cage? the script I was using a ref2 script and it just sat there saying "reflection cannot find walk path" or something like that. It just stayed logged in for like 3 hours saying that and didnt realize it was in the random.

Yago

2011-08-05 22:22:15

From: Jakkle
did you use the 1 I posted or are you on about the 1 already in ref2 did it ?


I downloaded ref2 yesterday so idk if its yours, but its the one that came with ref 2

mormonman

2011-08-06 02:33:05

From: Jakkle
did you use the 1 I posted or are you on about the 1 already in ref2 did it ?


I already fixed and added my forester update like 4 days ago…they changed the chat text the day after I solved it the first time.

Jakkle

2011-08-06 09:31:19

looks like there is more than 1 chat text tho, maybe even 3 or 4.
I did a fresh install of simba(to .97) and ref 2 yesterday after seeing you say only 3 randoms left to do.
Anyway the forester obviously was your newest update to it and it did not solve for me.
I checked the text and it had changed again so I took it that maybe adding all the chat text that come up into the code.

mormonman

2011-08-12 05:58:04

http://vid1212.photobucket.com/player.swf?file=http://vid1212.photobucket.com/albums/cc445/Trenton_Smith/mollysolver.mp4

Woot? One down, two to go.

kingarabian

2011-08-12 06:11:58

From: mormonman
http://vid1212.photobucket.com/player.swf?file=http://vid1212.photobucket.com/albums/cc445/Trenton_Smith/mollysolver.mp4

Woot? One down, two to go.


You…You…

:spot:

KingKong

2011-08-12 08:09:28

From: mormonman
http://vid1212.photobucket.com/player.swf?file=http://vid1212.photobucket.com/albums/cc445/Trenton_Smith/mollysolver.mp4

Woot? One down, two to go.


uh, i can still see the username, but other than that, good job!

Drakan

2011-08-12 09:19:56

lols u can. Just look at the NPC chat xD. Not like it matters
Great job babe.

Home

2011-08-12 09:34:20

Great job guys with these random solvers! :)

~Home

Yago

2011-08-12 11:14:52

Wow it solved it humanly except for grabbing the girl(I usually take a while to locate her :p)…

But dont listen to me and Good job guys.

ry0240

2011-08-12 12:08:27

That's awesome that almost all randoms are solvable now, I don't think we've ever had a point where 100% of randoms are solvable for this community. has there? Either way this is a huge step forward and would say were in another league past java bots due to SRL's other great features, randoms I think was the only thing that hindered us versus java bots in the past. Either way, great job on R2 guys. =]

mormonman

2011-08-12 13:18:59

From: ry0240
That's awesome that almost all randoms are solvable now, I don't think we've ever had a point where 100% of randoms are solvable for this community. has there? Either way this is a huge step forward and would say were in another league past java bots due to SRL's other great features, randoms I think was the only thing that hindered us versus java bots in the past. Either way, great job on R2 guys. =]


We have before. But yes its nice.

Harry

2011-08-12 14:12:51

Nice job, but yeah the name doesn't matter, it's the suicide-botted Reflection army anyways :p

Coh3n

2011-08-14 00:24:17

By the sounds of things, R2 is pretty stable. Perhaps it's time to release an updater extension?

Drakan

2011-08-14 00:29:49

From: Coh3n
By the sounds of things, R2 is pretty stable. Perhaps it's time to release an updater extension?


We're almost there. For sure we'll have to start considering that, though I need to look into a good way to incorporate the parent ID's for null npc's such as the balloon animals in prison pete. The only way I see doing this efficiently is by rewriting the way we use NPC's currently (which would be a great improvement overall, but take more time). For now I think we should just release and I can save all of that for v2.1. I'll also add in models now that I have ported it to Titan, I can figure it out for simba. I may consider using classes for them in FPC and just use plugins. We'll see. The direction of Lape will affect that though. If Lape doesn't support imported classes then we will run into troubles with models and possibly the new format for NPCs. All in due time I suppose, I've been working everyday for the past while so I haven't gotten much done. I have no clue what my schedule is for next week :P

Coh3n

2011-08-14 12:22:53

Sounds good. Whenever you guys feel is best. :)

Jakkle

2011-08-15 10:11:05

Could you add BoxReward solving pretty please :D <3

Coh3n

2011-08-15 10:12:11

From: Jakkle
Could you add BoxReward solving pretty please :D <3
It doesn't call SRL's solver?

Jakkle

2011-08-15 10:16:37

From: Coh3n
It doesn't call SRL's solver?


Well if it does, that ain't working. Everything seems grate tho with the random solving, just I come to have a look at my char and every time I do there is a rewards box waiting for me :p Bad thing tho is that it try quite a few times to bank it but can't, very bot like.

Edit: I have the newest ref2. This made me laugh as I was looking at what had been changed
"Tons of random solving. Too bad Drags doesn't help…"
Get your finger out drags haha, to busy with ref for scar by any chance ? hehe :p

**BANNED The Man

2011-08-15 12:36:58

So models will be in Titan soon? :D <3

<3 from Boom

mormonman

2011-08-15 14:44:19

From: Coh3n
It doesn't call SRL's solver?


No we are gonna make a reflection one and then if it fails call the color one. It shouldn't fail though. We already have made scrolling features before.

Flight

2011-08-15 20:24:01

From: mormonman
No we are gonna make a reflection one and then if it fails call the color one. It shouldn't fail though. We already have made scrolling features before.


With that being said, I have some ID's you might want. Do note, however, this list isn't complete, but it has alot of what we need.


Rewards Interface: 202

Child: 15

------------------------------

-Components-

Cash: 0

Gems: 42

Herbs: 49

Charms: 63

Lamp: 70

Mystery box: 175

------------------------
-XP Interface-

Interface: 134

-Children-

"Confirm": 2

"Close": 29

Attack: 4

Agility: 5

Herblore: 6

Fishing: 7

Thieving: 8

Runecrafting: 9

Slayer: 10

Farming: 11

Mining: 12

Smithing: 13

Hunting: 14

Cooking: 15

Firemaking: 16

Woodcutting: 17

Fletching: 18

Construction: 19

Summoning: 20

Strength: 21

Ranged: 22

Magic: 23

Defence: 24

Constitution (hitpoints): 25

Crafting: 26

Prayer: 27

Dungeoneering: 28

I hope that'll save some time when you start gathering Interface IDs for the rewards system.

Coh3n

2011-08-15 21:55:25

So why not just call the SRL one until a Reflection on has been written?

Brandon

2011-08-16 08:17:57

Just a warning to u guys… jagex screwed a lot of bots!! I just saw them all stuck outside edgeville bank.. whenever your scripting banking, make sure that the character is inside the bank!! why? because now when your not in the bank and u try to click bank, the character will no longer run into the bank to bank.. it will stay there clicking Bank Banker forever.. even though the banker is on screen, the character will not budge if outside the bank.

Echo_

2011-08-16 09:36:59

From: ggzz
Just a warning to u guys… jagex screwed a lot of bots!! I just saw them all stuck outside edgeville bank.. whenever your scripting banking, make sure that the character is inside the bank!! why? because now when your not in the bank and u try to click bank, the character will no longer run into the bank to bank.. it will stay there clicking Bank Banker forever.. even though the banker is on screen, the character will not budge if outside the bank.


Is this just for Edgeville or all banks now?

Coh3n

2011-08-16 10:23:02

From: Echo_
Is this just for Edgeville or all banks now?
My bots are still going strong softening clay at VE.

Drakan

2011-08-18 10:52:40

@Flight: Thanks but we have all the info for all the randoms xD. We just have to make them and stop being lazy. I've been kinda busy now that I'm back workin all the time now. Today's my day off so we'll see what I can get done.

Flight

2011-08-18 11:11:10

From: drags111
@Flight: Thanks but we have all the info for all the randoms xD. We just have to make them and stop being lazy. I've been kinda busy now that I'm back workin all the time now. Today's my day off so we'll see what I can get done.


I can most certainly relate.

mormonman

2011-08-18 18:15:23

I've been moving the past three days. I'm finally all settled in so I can do some work.

Jakkle

2011-08-18 19:48:31

From: mormonman
I've been moving the past three days. I'm finally all settled in so I can do some work.


Glad to here, hope its a nice place you got :) I know what it's like, moving house. Lots to do and I can never sleep around the time of moving :p haha.
Nice, will be glad to see more of your work, as always you've been doing a grate job doing alot for reflection recently. Keep up the good work :thumbsup:

Drakan

2011-08-18 19:51:04

He actually just moved in with his parents ;)

mormonman

2011-08-18 19:57:04

From: Drakan
He actually just moved in with his parents ;)


[Short story time]
I moved out for the summer to work and am now living with my parents while I attend a final semester at EAC before transferring to ASU. Its free and I'm poor.
[/Short story time]

Anyways, halfway through evilbob. Its super easy.

Flight

2011-08-18 20:37:50

Well Mormonman, I hope you know you have alteast me routin' for ya!

Jakkle

2011-08-18 21:57:57

Do you think there are hooks to get the time a player is logged in and also at the lobby screen. Would help alot with a break handler.

I have tried to mess about with the one in flights monkfishies script to make a MiniBreakHandler(as well as a normal break for 6 hours or so).
It Exits to the lobby for (whatever time) and (random time) as usual. I then tried to get 'time to next break:' in the debug box with a big fail. I kept thinking it was me but I now see that ever time it calls the break handler, it is randomly generated each time.

This is my code
//Global
Var
NextMiniBreakTime,MiniBreakRounds,
LoginMiniBreakTime,TotalMiniBreaks,
ho,mi,se: Integer;

Function MiniBreaks(MiniBreakIn, MiniBreakFor, RMiniBreakIn, RMiniBreakFor: Integer): Boolean;
Var
a,b,c,d,h,m,s,
RealBTime,
CurrentMiniBTime: integer;
begin
if not LoggedIn then Exit;

a := (MiniBreakIn * 60000);
b := (MiniBreakFor * 60000);
c := RandomRange(-RMiniBreakIn * 60000, RMiniBreakIn * 60000);
d := RandomRange(-RMiniBreakFor * 60000, RMiniBreakFor * 60000);
NextMiniBreakTime := ((a) + (c)); //Here complete randomness
if (HowManyPlayers = 1) then
begin
if (GetTimeRunning < ((NextMiniBreakTime) + MiniBreakRounds)) then Exit
else
if (GetTimeRunning > ((NextMiniBreakTime) + MiniBreakRounds)) then
begin
NextMiniBreakTime := ((a) + (c)); //Here not random but still not right
RealBTime := ((b+d)/60000);
Writeln('Taking a Short break for about ' + IntToStr(RealBTime) + ' minutes.');
ExitToLobby;
BreakScreen;
MarkTime(CurrentMiniBTime);
repeat
Wait(1000);
ConvertTime((b+d)-TimeFromMark(CurrentMiniBTime), h, m, s);
ClearDebug;
Writeln('Breaktime left: '+IntToStr(h)+':'+IntToStr(m)+':'+IntToStr(s));
until(TimeFromMark(CurrentMiniBTime)>(b+d));
Writeln('Logging in.');
OnScreen;
If R_LobbyScreen Then
MouseBox(270, 450, 490, 470, 1);
Wait(4000);
MarkTime(LoginMiniBreakTime);
Result := LoggedIn;
R_FindRandoms;
IncEx(MiniBreakRounds, (a) + (b));
Inc(TotalMiniBreaks);
SetAngle(true);
Writeln('The next mini break will occur in about ' + IntToStr(a+c) + ' minutes.');
end;
end;
end;

MiniBreaks(MiniBreakIn, MiniBreakFor, RBI, RBF);
If (TotalMiniBreaks > 0) Then
Begin
ConvertTime((NextMiniBreakTime)-TimeFromMark(LoginMiniBreakTime), ho, mi, se);
Wait(1000);
ClearDebug;
Writeln('Time to next break: '+IntToStr(ho)+':'+IntToStr(mi)+':'+IntToStr(se));
End;

As you might have seen, I have marked, in the function, the code
NextMiniBreakTime := ((a) + (c));
Which give a random number EVERY time breakhandler is called. So never selecting a time till next break.

mormonman

2011-08-18 22:01:13

I have no clue about the hooks, but make that a global variable and only change it once per break.

Drakan

2011-08-18 22:08:26

yeah honestly man u don't use reflection for that kinda stuff.

mormonman

2011-08-19 04:25:42

Ok, so finally committed Evil Bob. Started work on rewards.

Dynamite

2011-08-19 09:29:25

Psst: http://villavu.com/forum/showthread.php?t=62216&highlight=breakhandler

Jakkle ^ :)

Jakkle

2011-08-19 09:37:41

That is already in the script, which is for my main break. I've been trying to use it to do another break handler that will exit to lobby every half hour and log in after 1-5 mins and also at the same time output time till next break.

Drakan

2011-08-19 09:38:47

From: mormonman
Ok, so finally committed Evil Bob. Started work on rewards.


Alright, great job bud :) We're one step closer to a full release. The full release will probably happen soon and without prison pete being done. I already have plans for that in reflection 2.1, but the reason it's not being done here is because of the work I will have to do to change the way we do NPC's, objects, players, etc. It would take too much time. So plan on a full release very soon and I will post my plans for reflection 2.1 in a thread somewhere.

Jakkle

2011-08-20 11:37:53

Like the new title you guys have ;) we know who you are now lol :p

Harry

2011-08-20 11:40:48

Don't know if Maze solver is done yet, but you can talk to the Old man if your reward timer gets to 0% and he teleports you out into a random spot (like Prison Pete does). Just some info to whoever writes the solver, should take advantage of that if Reincarnate=True… :D

Drakan

2011-08-20 12:13:04

From: Harry
Don't know if Maze solver is done yet, but you can talk to the Old man if your reward timer gets to 0% and he teleports you out into a random spot (like Prison Pete does). Just some info to whoever writes the solver, should take advantage of that if Reincarnate=True… :D


Ya the maze solver is done. Its not 100% accurate due to the fact that the doors are tricky to click without models, but it works for the most part.

@Jakkle: Thanks :P Yeh I like the color :)

Jakkle

2011-08-22 20:32:58

Hey Drakan, just wondering have you got a date on the official release of Reflection 2 yet ?