edfromhumanresources
2011-04-16 17:16:08
How can one define and run threads in simba?
2011-04-16 17:16:08
2011-04-16 17:27:54
2011-04-16 17:30:37
2011-04-16 17:32:02
2011-04-16 17:48:50
2011-04-17 04:35:37
From: edfromhumanresources
Is this some sort of technical limitation or just no one has been arsed to implement it yet?
2011-04-19 11:59:27
From: Wizzup?
Obviously there's no actual ``technical'' limitation, as it would theoretically be possible. However, the interpreters in Simba don't support threading. And it's not easy to ``hack'' threading it. There are some other threading related hacks you can do though. Did you want another thread for performance or logic? (Generally I wouldn't recommend doing real performance-related work in Simba's interpreter…)
And if you don't want to use SRL; but say, only Simba's main functions. (Find colors, manipulate mouse, keyboard) you could also write your program in Free Pascal. Simba is written in this and you can easily extend your program with Simba units. Free Pascal supports threads and the Simba library AFAIK is thread safe. Eventually other languages will be supported.
2011-04-19 13:43:17
2011-04-19 13:53:26
From: edfromhumanresources
I just feel it would be highly beneficial for scripts that require fast response to multiple sources of change to split various tasks into threads and use semaphore/locking for flow control. I also think they would improve code readability if used well.
It's definetly something I'll look into when I have time.
2011-04-19 13:59:57
2011-04-19 14:08:31
From: i luffs yeww
Also, don't use Java.
2011-04-19 14:13:47
From: footballjds
you're not going to get true multithreading with simba/scar.
EVER
2011-04-20 05:40:52
From: footballjds
you're not going to get true multithreading with simba/scar.
EVER
2011-04-20 05:46:13
From: footballjds
you're not going to get true multithreading with simba/scar.
EVER
2011-04-20 06:12:32
2011-04-20 06:45:29
2011-04-20 07:40:13
From: Iamadam
@the general Java hate: …. A wild rage baby appears!
[rage]Java is incredible and far superior to PS in almost every way.
There, I said it.[/rage]
No offense meant to anyone, but just because Java is often associated with ignorant fools (i.e. powerbot.org) doesn't mean it is a bad language. It is fast, reliable and _excellent_ for runescape scripting if properly implemented.
Now on topic: No, TTimers don't work for 'multithreading' in PS. The 'onTimer' event is never called.
2011-04-20 07:57:10
2011-04-20 08:28:46
From: Iamadam
Its great for scripting because it can be as simple as piecing together a bunch of pre-written methods - but expanded to complex multithreaded object oriented scripts.
It has all the ease of PS, with a bunch of extra functionality.
As for the start up time, it can be slow - but when huge libraries (like SRL) are used in PS, it is just as slow to compile & run.
Nothing wrong with PS, and it works fine for what we use it for. But at the same time, there's a real ignorance in this community about what Java is and what its capabilities are (I don't mean you Wizzup? or anyone else in this thread). I understand that it has been given a bad name by a lot of cheating sites around the place (poorly designed bots make it appear far slower than it is, and poorly written scripts combined with the general stupidity of most on Java based bot sites probably suck appeal from it).
I just gotta advocate for Java because its the reason I got into programming, and I know people who can use it to do amazing things :)
2011-04-20 10:02:34
From: i luffs yeww
That's not true. With a changed interpreter and language we could. According to Wizzup?, Simba/MML can handle threads, so if we used a language that could support threads, we could use threads with Simba.
The reason we can't use threads now is because we're using PascalScript (same reason why SCAR won't support threads any time soon).
Python will be first, and I don't know if anyone will want to use threads with that, but another language may.
From: Wizzup?
I've been thinking for five minutes or so to express how dumb I find this post, but without trying to offend you. I just ended up with this. I can't think of anything more suitable.
Richard, seeing SRL doesn't do client hacking I don't see the advantage of making SRL ``just another java bot''. Java isn't a programming language fit for scripting either.
2011-04-20 10:19:06
From: footballjds
I meant that the language we currently use(not the compiler, i simply associated the two… :duh: ) is holding us back. My mistake almighty SRLer's
2011-04-20 10:20:09
From: Wizzup?
That's true. If you by language mean PascalScript. :)
2011-04-20 10:29:15
2011-04-20 11:07:40
2011-04-20 15:06:10
From: Iamadam
words
From: Wizzup?
It's statically typed, this is huge disadvantage if you want use it as scripting language.
2011-04-20 15:32:34
From: i luffs yeww
I, quite honestly, just really think that Java has a lot of silly "features" and non-features that don't make an awful lot of sense. I don't like garbage collection (at at least not Java's, in practice with most Java applications), I don't like the JVM, and it's just a nuisance to have running, imo. And not only this, but I see no reason to use it over any other language (if there was no C or C++, but Java somehow existed as it does today, then maybe it would be a decent language choice, but that's not the case). I know my arguments aren't very technical, but whatever. I'll look more into Java's internals later if I can.
I don't understand that at all. Why would dynamic typing be a good choice, ever? I don't think the speed loss, increased confusion, and chances that things will work together being lowered are at a low enough cost that the pros win (pros don't outweigh the cons for dynamically typed languages).
2011-04-20 19:35:53
2011-04-21 03:47:48
From: Iamadam
When I was talking about Java, I didn't mean to push it as a replacement for PS. Was just defending the fact that it's great :P
Also, garbage collection is amazing. "Memory leaks? What are they??"
2011-04-21 04:25:40
From: Wizzup?
Dynamic languages:
- Eval, map, etc
- Don't check for runtime errors on compilation (this is a good thing)
- Duck typing, code reuse. Code is often a lot smaller, more readable.
- lambda calculus
- Pickling, marshalling, etc.
2011-04-22 16:50:38
From: nielsie95
dat quote.