SRL Archive - First Scripts

CFletch


cahker

2011-12-11 16:14:53

This is the first script I made, it would be helpful if you looked over the code for mistakes that I undoubtedly made. I'll be adding more features, but wanted to get it out there in case I'm making really bad code or something.

____________________


CFletch v0.1


Features:
- Multiple players
(you suggest)

Support for:
- Cutting logs
(you suggest)

Instructions:
- Install SMART if you don't have it
- Start in varrock west bank, have a knife in your inventory and normal logs visible in your bank
- Fill out your account info at the top of the script
- Run the script

Known bugs:
None yet, report anything you see

Notes:
Cutting logs does make a decent profit. It may take some time to buy logs guide price, do not go too much higher. Arrow shafts usually sell instantly, and are easy to sell over guide price.

Credit to Silent Spy for his scripts, which I used as a reference to add multiplayer support and other code

PatDuffy

2011-12-11 16:25:57

Well to comment on the code, you do not seem to have multiplayer support correct, there needs to be a
Players[0].Name := ''; // Username[SIMBA]
Players[0].Pass := ''; // Password
Players[0].Active := True; // True if you are using this player
Players[0].Pin := ''; // Leave blank if the player doesn't have a bank pin
Players[0].Integers[1] := 10000; // Number of loads

for every Player, increasing the [#] by 1 for each.

You also did not call FindNormalRandoms correctly, it should look like this
  if FindNormalRandoms then
if not LoggedIn then
Exit;

If you had wanted to add multiplayer support, then this would be changed from
      InPin(Players[0].Pin); 
to
      InPin(Players[CurrentPlayer].Pin); 

Also, the place where you freed your DTM's is ineffective, and will eventually lead to a memory build-up, You should call InitDTMs before you do FindDTM, then after you have the location(x,y) of the DTM, call FreeDTMS.

Other than that, great job on your first script!

cahker

2011-12-11 16:39:53

Alright, changed some of the code and uploaded it again. Calls FindNormal Randoms correctly, and uses multiplayer correctly. (I didn't have multiple members accounts to test).

I'm not exactly sure what you mean about the DTMs. Do you just put the free DTM after every findDTM, they can be called afterwards again?

quazzymodem

2011-12-15 00:32:46

This worked for a few loads than just stopped when trying to take logs out of the bank, I tried updating the dtm too and no luck

also seems to be an error with the script occasionally not clicking on the knife too (might have been lag)

EDIT: made a really good dtm for the logs and it seems to be working now. '78DA630C616160E0616440069EE60A601A26CA180154238AAA86818109558D2F508D380135294035BCB8D580588C094035EC04D47802D570E0570300BD2E0335'

cahker

2011-12-15 09:23:48

I'll be updating this soon, add support to fletch almost any item, add failsafes, and make progress reports. I'm pretty busy with finals.

quazzymodem

2011-12-15 16:10:25

Sounds great cahker, I actually edited your script for my own purposes doing what you just described, im having a few issues with making the script use the knife in my toolbelt though. let me know if you would like to see my edits.

naox

2011-12-16 08:31:50

works good, but my bot is making shart and i wanna make bows

Smingo

2011-12-19 17:44:46

Well I changed the DTM for logs so it will work for all but now it just hovers over logs and doesn`t withdraw them.