SRL Archive - Research & Development Lounge

DaInclude


Da 0wner

2009-02-03 19:18:52

DaInclude is a include I am working on.

It will be very good and cool with useful functions.

No files are currently released. Keep an eye here for when they are!

This project is currently on hold until furher notice!
Sorry for an inconvenience caused.


Function List
Note: Subject to Change

RC Routines DaInclude/RC.scar

SetRCMaster(Username, Password : string); Complete
Sets the RC username and password. This is the only account that can send messages to the bot and execute the command.
Note: The password in this function is NOT the password of the account. It is used for verification so a person that has access to your account can not control the bot.

CheckRC(AllowSetVar, AllowSay, AllowLogoff, AllowGetVar : boolean); Complete
Checks if an RC command has been sent by the RC master player and if it has been sent and the command is allowed it will execute it and send a message back.

RC Commands
SetVar(Varname, SetTo) Complete
Say(SayWhat) Complete
Logoff() Complete
GetVar(Varname) Complete
Verify(Password) Complete
Reset() Complete
Sleep(HowManyMins) Complete (Idea by Baked0420)

Repository Routines DaInclude/Repository.scar

DownloadFullRepository(RepositoryURL, InstallPath : string) : boolean; Complete
Downloads the whole repository and all subfolders to the install path.

DownloadRepositoryFile(FileURL, InstallPath : string) : boolean; Complete
Downloads a single file from the repository.

DownloadRepositoryFolder(FolderURL, InstallPath : string) : boolean; Complete
Downloads a single folder and subfolders in that folder to the install path.

CheckRepositoryRevision(RepositoryURL, CurrentRevision : string) : boolean; Incomplete
Checks the revision of the repository specified and compares to the current revision. If the head revision is bigger then the current revision returns false. If the head revision is lower than the CurrentRevision or the head revision is the same than CurrentRevision it returns true.

Misc Routines DaInclude/Misc.scar

Count(s1 : s2 : string) : integer; Complete
Counts how many times s1 is in s2 and returns the amount.

GetLastPM(Sender : boolean) : string; Complete
If sender is true it will return only the sender of the last PM, if it is false it will return only the text of the last PM.

Browse : string; Complete
Opens a browse window and returns the filename of the selected file.

DTMLib Routines DaInclude/DTMLib.scar
The libraries talked about in this routine will be created with a DTM Library Manager created by me. It will have the ability to import and export libraries as well as editing them. Scripts can share libraries.

GetDTM(LibraryPath, DTMCategory, DTMName : string) : integer; Incomplete
Returns the DTM specified in the library specified.

SetDTM(LibraryPath, DTMCategory, DTMName, DTM : string); Incomplete
Sets the specifed DTM in the library specified to the DTM specified. Will create it if not already made, otherwise will replace it. If libary dosen't exist it will create a new one.

RemoveDTM(LibraryPath, DTMCategory, DTMName : string); Incomplete
Removes the specified DTM in the library specified.

Reflection Routines DaInclude/Reflection.scar

WalkPath(Path : TPointArray); Complete
Walks the specified path.

SetPath; Incomplete
This procedure should not be used in scripts! For script makers only. It is a function that will create a path and write all the points in the debug when user presses F1 and will stop when F2 is pressed.

ian.

2009-02-03 20:54:35

nice :o!

can't wait to see how it works :)

Da 0wner

2009-02-04 03:06:22

Update: RC completed.

Baked0420

2009-02-04 06:02:05

nice, I auto for my friend so I was thinking of making Logout; and Sleep(HowManyMinute: Integer); procedures for him, so if he wants to play he could just tell it to logout from his other acc he just made or if he knows how long he'll be on just tell it to sleep for how many minutes he'll be playing. I think the Sleep is a great idea, and if you just credit me for the idea, then I don't care if you use it.

Da 0wner

2009-02-04 06:33:44

Mmk, I'll add sleep to RC commands.

Baked0420

2009-02-04 06:55:30

You don't have to, I just think it'd be a good one to have, incase like you want it to logout, then you go on real quick, sell raw materials (or w/e you were doing with auto) on g/e then run it back to where it was, then have it log back in. But remember, you can't call the procedure/function Sleep, you'll get duplicate identifier error I think, because sleep already exist, but if you do add this, I think you should make it find out how long the RCMaster wants the bot to sleep for, then just add a few minutes random to it maybe? or random seconds? so it doesn't log in perfectly after 5 minutes. I just think it'd be less dectectable that way. And goodjob on this project by the way :)

Da 0wner

2009-02-04 07:44:42

Actually, the way this script is set up the duplicate identifiers won't matter. And yes it would do that. The thing is you can make it login after but if you are on longer than that it will login and continue and if you aren't by trees or w/e it will error and stuff like that. So be cautious when using Sleep RC command as you can't send RC commands to the bot if it isn't logged in ;p.

Baked0420

2009-02-04 08:18:13

yea I was thinking of all those things, thats why I said run back to where it was, thatd be very important, and that's cool, you can use sleep without duplicate identifier, but how would scar know which one we want to use? and if you are on longer then the sleep time it won't logon and continue, it can't login if you already are, that could be another problem, which is why it's good to add a few random minutes, just a few, incase someone goes over by a minute or two, and estimated wrong.

Da 0wner

2009-02-04 09:10:22

Yeah sleep shouldn't be used much. And the structure of the RC routines will not interfere with the duplicate identifier becasue it dosen't execute the procedure streight from the sent text. If it finds text in the message like Verify('') it will get the message in between and run from there.

Ex: You can use different procedure names in there than you are going to run.