View Full Version : Pascal Questions
Kevin
12-04-2012, 02:25 AM
Over time I've come up with a list of questions for programming in Pascal and SRL in general.
1) How do I add an apostraphe in a string? I assume it's as simple as an introductory escape character or quotation mark string declaration or something like that, but I don't know and it seems like s simple enough starter question
2) Is there some API for commonly used functions for us scripters?
3) Is there some listing on how to grab any sort of object metadata on Runescape items outside of their current GE price, or would we need a custom server/website of our own to hold this information so we could grab it all later?
4) Back to simpler questions... When a script is multiplayer, is it running the players asynchronously, or synchronously? and if it is synchronous typically, does Pascal (pr SRL) allow for any sort of async activity?
5) Finally, if the answer to 4 is a no to asynchronous possibilities currently, would the language theoretically allow for our own additions to make our own asynchornous improvements so advanced developers could use them for a variety of things, like multiple players working at once (possibly even together) or simpler things like looking up GE prices while continuing to run a script as normal?
Le Jingle
12-04-2012, 02:33 AM
SRL uses pascalscript, interpreter of pascal.
writeln apostrophe's by,
writeln('hi it''s me');
docs.villavu.com
It's usually along the lines of grabbing your own data off a reliable server/website for said data.
in simba 1.00 I believe its suppose to support multiple smart's in one simba process (you have to have multiple scripts, you can't run the same script synchronously in the same simba process).
e:
pascalscript (https://github.com/SRL/SRL-5) doesn't multithread, lape (http://villavu.com/forum/showthread.php?t=68613) (what is being moved towards instead of pascalscript) is being developed here (https://github.com/SRL/SRL-6). But the nice thing about villavu is that you can view all source code simba (https://github.com/MerlijnWajer/Simba).
Daniel
12-04-2012, 03:06 AM
Over time I've come up with a list of questions for programming in Pascal and SRL in general.
1) How do I add an apostraphe in a string?
There are multiple ways:
S := 'String''s';
S := 'String'#39's';
S := 'String' + #39 + 's';
S := 'String' + Chr(39) + 's';
2) Is there some API for commonly used functions for us scripters?
See the Simba documentation (http://docs.villavu.com/simba/). A library which is in common use by most of the members here is the SRL Resource Library (SRL) (http://docs.villavu.com/srl-5/)
3) Is there some listing on how to grab any sort of object metadata on Runescape items outside of their current GE price, or would we need a custom server/website of our own to hold this information so we could grab it all later?
WYSIWYG with Simba, unfortunately. However, there is work on some middleware development on OpenGL hooking (http://villavu.com/forum/showthread.php?p=1083734#post1083734).
4) Back to simpler questions... When a script is multiplayer, is it running the players asynchronously, or synchronously? and if it is synchronous typically, does Pascal (pr SRL) allow for any sort of async activity?
Synchronously. And not really, no (unless you base your script on low priority Windows timers (http://msdn.microsoft.com/en-us/library/system.timers.timer.aspx); which is kind of asynchronous [not really]).
5) Finally, if the answer to 4 is a no to asynchronous possibilities currently, would the language theoretically allow for our own additions to make our own asynchornous improvements so advanced developers could use them for a variety of things, like multiple players working at once (possibly even together) or simpler things like looking up GE prices while continuing to run a script as normal?
PascalScript (http://www.remobjects.com/ps.aspx) (the pascal interpreter that Simba uses) is fairly limited. You could potentially create an external library (e.g. DLL) and either statically or dynamically link with it, which you could then utilise that language's parallel features (although, that'd essentially be a separate program).
Rezozo
12-04-2012, 03:20 AM
Go Daniel, you are on top of this! Hey Nivek, if you really need help in the basics of the basics, check the TuT in my signature. Though it hasn't been updated in around a month, there are sequels and the information stays the same.
~Rez
Kevin
12-04-2012, 05:13 AM
Thank you for the prompt responses guys!
So no single reliable server for all that metadata that could be fairly valuable? Would it be reasonable (definitely seems possible so long as we can perform HTTP requests, which knowing we can access GE prices makes me think we can), for someone to create a series of new functions to access item metadata via some existing site like runescape.wikia.com? Or perhaps even simpler have it somehow integrated here into Villavu?
As for creating the external dll that is then linked to in order to add possible asynchronous functionality: Would that be possible as a creation to improve upon SIMBA as a whole in a future release? I have what I would like to think of as a fairly broad knowledge of C++ and would be more than willing to work on that with someone else. I could theoretically do it on my own, but since I'm not too knowledgeable on the Pascal, side it could take a while.
And thanks for the offer Rezozo, but I think I have most of the Pascal basics down, I just had the couple questions I hadn't seen mentioned elsewhere to throw into the deeper questions like I'm digging into now.
Rezozo
12-04-2012, 05:18 AM
Understood. Well, you know I am always here to help. But ask others like Daniel first :D
~Rez
Le Jingle
12-04-2012, 05:39 AM
I'd suggest ask questions as often you need to, PM is great here, or even join the irc (lot of smartness in irc channel (http://villavu.com/forum/showthread.php?t=66101)).
As for item data, it would prove useful, imo, but I'd stay away from hard coding anything..and try to organize it.
Cheers
Lj
Daniel
12-04-2012, 05:43 AM
So no single reliable server for all that metadata that could be fairly valuable? Would it be reasonable (definitely seems possible so long as we can perform HTTP requests, which knowing we can access GE prices makes me think we can), for someone to create a series of new functions to access item metadata via some existing site like runescape.wikia.com? Or perhaps even simpler have it somehow integrated here into Villavu?
Very possible. Simba supports both HTTP-POST and (obviously) HTTP-GET messages.
As for creating the external dll that is then linked to in order to add possible asynchronous functionality: Would that be possible as a creation to improve upon SIMBA as a whole in a future release?
No, I wouldn't think so. I meant specifically for your script (i.e. you have your library, you export a method, call that method in Simba. That method then does all macro stuff [hence why I referred to it as pretty much a separate program]).
I don't think PascalScript or La-pe support RTTI, so you can't really use that to export threading/async functionality. You could try to use pointers in La-pe and get your DLL to introduce asychronous calls that way, but I haven't really explored that area.
Dgby714
12-04-2012, 06:01 AM
Just gonna jump in here =)
I like to see these questions!
nivek, you should come hang out on IRC.
Kevin
12-05-2012, 05:10 AM
Hard-coding is for losers :)
As for the IRC, I don't see Rizon.net to connect to... Have the settings changed since that post was written in 2008?
Powered by vBulletin® Version 4.2.1 Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.