Author Topic: single script w/multiple instance idea  (Read 10491 times)

0 Members and 1 Guest are viewing this topic.

Offline goatmasterTopic starter

  • Newbie
  • *
  • Posts: 3
  • Activity:
    0%
  • Reputation Power: 0
  • goatmaster has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
single script w/multiple instance idea
« on: July 25, 2008, 04:32:44 AM »
0
Hi TM,

I have been developing a combat script and was thinking about how I can run healing routines whilst other routines are being ran in this script, (possibly slowing it down, etc) The most efficient way seems to be using separate healing script and you can utilize the namespace features to coordinate with each other.

I thought of a nifty idea that I think would be quite cool, the simplest way to explain is to imagine 2 totally separate scripts within the one "filename.suo" file, and the two scripts are simply wrapped in a tag such as <script>code</script>, and the code in those tags are executed in separate instances in scriptuo as if you have them in separate tabs, except scriptuo coordinates that itself.

This would give me the ability to write a complete script in one simple file yet maintaining the efficiency of multiple instances such as a combat script + a healing script together which is quite common.

Cheers



Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: single script w/multiple instance idea
« Reply #1 on: July 25, 2008, 09:47:50 PM »
0
I think you can kinda get that now if I understand your question correctly.  Suppose you want two script to interact with one another.  Under normal circumstances, these scripts will have separate memory spaces and local namespaces.  However, if you make both scripts run out the same global namespace, then they'll be able to interact with one another.  Problem is that I'm not sure the current implementation of namespaces within EasyUO isn't 100% correct since I've been able to crash EasyUO on more than one occasion when I get overly namespace happy.

However, it seems like you are asking to perhaps have one script be able to spawn multiple "threads".  It that more like what you are thinking?
« Last Edit: July 25, 2008, 09:57:22 PM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline goatmasterTopic starter

  • Newbie
  • *
  • Posts: 3
  • Activity:
    0%
  • Reputation Power: 0
  • goatmaster has no influence.
  • Respect: 0
  • Referrals: 0
    • View Profile
Re: single script w/multiple instance idea
« Reply #2 on: July 25, 2008, 11:02:07 PM »
0
Yep, multiple threads is exactly what I was thinking. You could continue to use the existing global namespace for communication between the two or there might be some possibilities of enhanced features for communication with this sort of single script 'multi-threading' idea.

I think the big benefits would be allowing writers to write single scripts which are much more advanced yet still run fast, and also other scripts, such as combat and bot which could benefit from multi-threading, such as x-healing and magic casting simultaneously.

Offline Superslayer

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: single script w/multiple instance idea
« Reply #3 on: January 24, 2009, 05:37:41 PM »
0
Or running a rail while scanning for character changes?  Such as death, menubutton presses, skill use?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: single script w/multiple instance idea
« Reply #4 on: January 24, 2009, 05:43:40 PM »
0
Well, that's what my rail engine does when you run it in "SERVER" mode.  :)
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline Superslayer

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: single script w/multiple instance idea
« Reply #5 on: January 24, 2009, 08:17:43 PM »
0
Ahh, the option I have yet to try out.  I dl'd it already (as per a previous post regarding it) and am having a great time with it.  Looks like I have more fun on the horizon  ;D ;).


BTW, any word on the next beta release?

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: single script w/multiple instance idea
« Reply #6 on: January 25, 2009, 02:54:46 AM »
0
Not sure when the next version will be out.  I'm in the middle of re-writing a bit of the data structures.  It's a bit of a mess at the moment.
Please read the ScriptUO site RULES
Come play RIFT with me!

Tags: