# Thread: [Reflection] Kyle's eFighter Account Trainer

1. ## [Reflection] Kyle's eFighter Account Trainer

So it had been a while since I had released a script, and I have never released one with the new reflection include. I was bored last night and decided to whip something up. I tried to write this in a very clean and efficient way in which it will be both modular to easily add on to it, and helpful for people to learn how to script with reflection.

What it is, is a simple startup account combat trainer, which all you need to do is put Iron, Steel, Mithril, Adamant, and Rune Scimitars in the bank (One of each, only for current attack level and up) and it will attack goblins by the goblin house, deathwalking and grabbing the needed scimitars when needed. It will train Attack, Strength, Hitpoints, and if you select it, Defense and Prayer.

With the script being so modular and easy to add new locations, I plan on adding more monsters when the player reaches certain levels, if you could recommend what levels you would like to do I can add quite easily (I was thinking about monks next).

It has no mouse movements (which I explain in the script how to add) and minimal antiban as this in meant for starter accounts.

Enjoy and post progress reports and let me know of any bugs or what you would like to see added.

If anyone wouldn't mind making this thread a bit more interesting and less wall of text like, let me know that as well

Code:
Version: 1
Running for 180 Minutes
Gained 7 Attack Levels, 0 Strength Levels, 7 Defense levels, and 6 Prayer levels
Currently fighting Goblins using Block attack style
Last edited by Kyle; 12-21-2015 at 01:53 AM.

2. shit script.

edit: STILL can't rep+ you, you'll get it once its possible.

3. Rlp
SRL Junior Member
Join Date
Jul 2012
Posts
181
Mentioned
4 Post(s)
Quoted
67 Post(s)
Originally Posted by elfyyy
So it had been a while since I had released a script, and I have never released one with the new reflection include. I was bored last night and decided to whip something up. I tried to write this in a very clean and efficient way in which it will be both modular to easily add on to it, and helpful for people to learn how to script with reflection.

What it is, is a simple startup account combat trainer, which all you need to do is put Iron, Steel, Mithril, Adamant, and Rune Scimitars in the bank (One of each, only for current attack level and up) and it will attack goblins by the goblin house, deathwalking and grabbing the needed scimitars when needed. It will train Attack, Strength, Hitpoints, and if you select it, Defense and Prayer.

With the script being so modular and easy to add new locations, I plan on adding more monsters when the player reaches certain levels, if you could recommend what levels you would like to do I can add quite easily (I was thinking about monks next).

It has no mouse movements (which I explain in the script how to add) and minimal antiban as this in meant for starter accounts.

Enjoy and post progress reports and let me know of any bugs or what you would like to see added.

If anyone wouldn't mind making this thread a bit more interesting and less wall of text like, let me know that as well

Code:
Version: 1
Running for 180 Minutes
Gained 7 Attack Levels, 0 Strength Levels, 7 Defense levels, and 6 Prayer levels
Currently fighting Goblins using Block attack style
I will probably give this a go later Elfyyy.

As for what to add to it, Cows, Chickens and the giant rats outside lumbridge castle would be worth looking at.

4. SRL Junior Member
Join Date
Jan 2007
Posts
181
Mentioned
0 Post(s)
Quoted
0 Post(s)
Been using it at the goblins at Lumbridge I can see the bot stops at times to look for bones but when it doesn't find any bones to pickup it just stands around waiting for bones and never goes back to attacking monsters until the inventory is full... any ideas? Even when I edit the script so its not meant to pick items up it seems that it works amazing for a little bit then after 10-15 minutes it'll just stop doing anything, script doesnt give any errors it just doesn't attack or move...
Last edited by Hamish; 12-17-2015 at 06:48 PM.

5. Originally Posted by Hamish
Been using it at the goblins at Lumbridge I can see the bot stops at times to look for bones but when it doesn't find any bones to pickup it just stands around waiting for bones and never goes back to attacking monsters until the inventory is full... any ideas? Even when I edit the script so its not meant to pick items up it seems that it works amazing for a little bit then after 10-15 minutes it'll just stop doing anything, script doesnt give any errors it just doesn't attack or move...
Hmmm that's odd, never saw that when testing. I've changed a lot with the include lately so maybe something with that messed it up. I'll check it later when I get off work.

6. Script updated to V1.2.. Few small fixes and updated to new pastebin link setup

7. SRL Junior Member
Join Date
Apr 2013
Posts
680
Mentioned
13 Post(s)
Quoted
341 Post(s)

## ?

Code:
procedure TReflectionMouse.Move(Pnt: TPoint; RanX, RanY: Integer); override;
begin
MoveMouse(Pnt.X + RandomRange(0, RanX), Pnt.Y + RandomRange(0,RanY));
end;
I pinch the snippet to over-ride the mouse functions; but i was getting horrible results, i could not work out what it was or duplicate it. The mouse would seems miss mouse by 20+ pixels; sometimes seemingly more. (i'm not sure how <- i'm talking about a (+3 variance))

(-Ranx, Ranx) is a tall stretch from (+Ranx); therefore i changed it to (0,Ranx); This has yielded better much better results.

8. SRL Junior Member
Join Date
Jun 2015
Location
New Zealand
Posts
322
Mentioned
2 Post(s)
Quoted
131 Post(s)
Good job Kyle

9. I was planning on trying this on a lvl 3, but i'm getting this error:
Error: Duplicate declaration "SetRun" at line 78
Compiling failed.
any ideas?

10. SRL Junior Member
Join Date
Apr 2013
Posts
680
Mentioned
13 Post(s)
Quoted
341 Post(s)
Originally Posted by jstemper
I was planning on trying this on a lvl 3, but i'm getting this error:
Error: Duplicate declaration "SetRun" at line 78
Compiling failed.
any ideas?
Just delete the entire function 'setrun' it is now in the include.

11. Originally Posted by AFools
Just delete the entire function 'setrun' it is now in the include.
Thanks bro, i've been out of 07 loop for awhile

12. Registered User
Join Date
Jan 2016
Posts
10
Mentioned
0 Post(s)
Quoted
1 Post(s)
Looks good thanks for this

13. SRL Junior Member
Join Date
Dec 2015
Location
where do you live!
Posts
30
Mentioned
2 Post(s)
Quoted
13 Post(s)
This script is great!

Although, I did have an issue--with not detecting the correct weapon if it was already equipped. Then the script would head to the bank, not be able to find the correct weapon, eventually getting lost on the top floor while trying to go downstairs.

I disabled the functions for heading to the bank/swapping weapons and was able to be using it for several hours without many hiccups. ^.^

I leveled one account to level 25+ attack at the goblins :P

14. Registered User
Join Date
Feb 2015
Posts
21
Mentioned
0 Post(s)
Quoted
5 Post(s)
Originally Posted by Keelijh
This script is great!

Although, I did have an issue--with not detecting the correct weapon if it was already equipped. Then the script would head to the bank, not be able to find the correct weapon, eventually getting lost on the top floor while trying to go downstairs.

I disabled the functions for heading to the bank/swapping weapons and was able to be using it for several hours without many hiccups. ^.^

I leveled one account to level 25+ attack at the goblins :P
have you progressed any other stats with this script or been hit with a banhammer?

15. SRL Junior Member
Join Date
Apr 2015
Posts
45
Mentioned
1 Post(s)
Quoted
17 Post(s)
I must be doing something wrong; i setup the script to fight the goblins and train pray. It kills the goblin but doesn't pick up the bones/bury them

16. Registered User
Join Date
May 2015
Posts
10
Mentioned
0 Post(s)
Quoted
2 Post(s)
I love this script but one thing bother me and i stopped useing this script because of it.
I want the mousemovement ok, it works.

But everytime it search for new npc to attack, it reset the mousepointer. it jumps to northwest corner of the game and works from there to goblin and attack.

This seem very bad and i hope there is a fix for it.

I mean can the mouse just stay at the same point as it attacked last time.
and from there, do new attack or search for goblin. not that the mouse jumps to the northwest corner of runescape, and works down to the goblin target. please i hope you understand my bad language.
Last edited by nik3x; 02-03-2016 at 07:11 PM.

17. Registered User
Join Date
Feb 2016
Posts
13
Mentioned
0 Post(s)
Quoted
4 Post(s)
Originally Posted by Keelijh
This script is great!

Although, I did have an issue--with not detecting the correct weapon if it was already equipped. Then the script would head to the bank, not be able to find the correct weapon, eventually getting lost on the top floor while trying to go downstairs.

I disabled the functions for heading to the bank/swapping weapons and was able to be using it for several hours without many hiccups. ^.^

I leveled one account to level 25+ attack at the goblins :P
Originally Posted by Hodor123
I must be doing something wrong; i setup the script to fight the goblins and train pray. It kills the goblin but doesn't pick up the bones/bury them
I'm having both of these issues as well. I'll edit this post if I figure either of them out.

edit1: hmmm seems that Bones.GetMSPoint is giving {-1,-1} and Bones.GetTile is giving {0,0}

edit2: I see! Bones.Find('Bones', 5) is returning false!

edit3: Strange. I've made a variable Debug: TReflectGroundItemArray; and I iterate through all of it's elements but they all give me blank output for GetName:
Code:
for i:=0   to Length(Debug)-1 do
begin
WriteLn(Debug[i]);
WriteLn(Debug[i].GetName);
end;
edit4: ok so setting Bones.Find("Bones", 5) -> Bones.Find(1, 5) fixes the problem it seems. btw is there any documentation of the Reflect include? It was kind of painful digging through the code, especially when I'm not super familiar with Lape syntax (is there good documentation for that anywhere?)
Last edited by bran_corn; 02-13-2016 at 05:34 PM.

18. SRL Junior Member
Join Date
Dec 2015
Location
where do you live!
Posts
30
Mentioned
2 Post(s)
Quoted
13 Post(s)
Originally Posted by bran_corn
btw is there any documentation of the Reflect include? It was kind of painful digging through the code, especially when I'm not super familiar with Lape syntax (is there good documentation for that anywhere?)
On the github portal for Reflection, there is little in the way of actual documentation. Your best option for learning, IMHO, would be to review Reflection-based scripts, and search for scripts with documentation, although not many public scripts are as well-documented as I would like to see. I can't blame people though, documenting for this kinda stuff seems silly mainly because, well, it's a free-to-play online video game among other reasons(facetiousness intended ).

For example, @ineedbot has several well made scripts you could reference. Take a gander at the custom functions published on these forums (on that note, thanks again, iNeedBot!). The layout and format of iNeedBot's scripts make absorbing the marrow of the procedures/functions seem less daunting.

It'd be a great idea for the community to begin documenting the major includes better, at the very least. Sure, there are tutorials on the forums, however the includes ought to contain snippets-examples on the use of a function, definitions of variables/parameters/etc.

19. Registered User
Join Date
Feb 2016
Posts
13
Mentioned
0 Post(s)
Quoted
4 Post(s)
I found this but it's pretty incomplete. The lack of documentation is making it much more difficult to learn. I feel like documentation is less fun to write than code but is almost as important. In R or python you can load up a package somebody else wrote and be using it within a couple minute whereas here I find myself having to read through the code multiple times and writing test code to figure things out.

But yeah, thanks for the advice I've been reading over iNeedBot's code to figure things out and will continue!

In the way of reflection documentation there's a section containing some tutorials https://villavu.com/forum/forumdisplay.php?f=659

Hope this helps a bit
Last edited by KeepBotting; 02-13-2016 at 08:55 PM.

21. Registered User
Join Date
Aug 2015
Posts
16
Mentioned
0 Post(s)
Quoted
8 Post(s)
Error: Duplicate declaration "SetRun" at line 78

78- procedure TReflectLocalPlayer.SetRun(Toggle: Boolean);

22. SRL Junior Member
Join Date
Oct 2015
Posts
80
Mentioned
2 Post(s)
Quoted
35 Post(s)
Originally Posted by maikelpro99
Error: Duplicate declaration "SetRun" at line 78

78- procedure TReflectLocalPlayer.SetRun(Toggle: Boolean);

On the otherhand, I'm getting

Error: Unknown declaration "Init" at line 86
I already have the latest version of Prosocks.DLL not sure why it's bugigng out for me. @Kyle;

23. SRL Junior Member
Join Date
Oct 2015
Posts
80
Mentioned
2 Post(s)
Quoted
35 Post(s)
updated prosocks.dll getting this now:

Error: Unknown declaration "GetWeildedWeapon" at line 152

24. SRL Junior Member
Join Date
Apr 2015
Posts
45
Mentioned
1 Post(s)
Quoted
17 Post(s)
Thanks for the handy debug/repair. I've been inactive but still want to thank you!

25. Mj
SRL Junior Member
Join Date
Jan 2014
Posts
51
Mentioned
5 Post(s)
Quoted
24 Post(s)
Originally Posted by terrorbyte
updated prosocks.dll getting this now:
Typo was fixed in a newer include version change the line to GetWieldedWeapon