Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ Bug reports
➜ some new suggestions and some bugs???
some new suggestions and some bugs???
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Smeagol
(10 posts) Bio
|
Date
| Sun 13 Oct 2002 03:52 AM (UTC) |
Message
| i also want to add that the script section in adding timers/triggers/variables we should be able to add parameters like test(%1, %2) or delete("something") and if it is blank it just gets the wildcards... | Top |
|
Posted by
| Nick Gammon
Australia (23,133 posts) Bio
Forum Administrator |
Date
| Reply #1 on Sun 13 Oct 2002 07:22 AM (UTC) |
Message
| Not sure I understand this one.
The "script" section is just the name of a script, not a scripting command as such. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Faolong
USA (28 posts) Bio
|
Date
| Reply #2 on Mon 14 Oct 2002 03:12 PM (UTC) |
Message
| I think that he means that in the script part in a trigger/alias/timer... etc... he wants to call a jscript function and be able to insert arguments into that function... Because right now, it doesn't allow us to do that... And if the arguments were blank, it would just be the array wildcardsVB. | Top |
|
Posted by
| Shadowfyr
USA (1,790 posts) Bio
|
Date
| Reply #3 on Mon 14 Oct 2002 09:34 PM (UTC) Amended on Mon 14 Oct 2002 09:39 PM (UTC) by Shadowfyr
|
Message
| Which of course won't really work.. Compilers allow this because they can include headers or 'pre-declaration' in the code that specify what the parameters 'should' be, they also allow you to 'overload' them by making more than one definition in most objects oriented languages. Scripts don't use the first of these, since the engines that run them don't really care what 'order' the subs came in, while a compiler needs to run everything through an initial first pass to make sure all of the needed subs have been declared and actually exist. As for overloading... I am fairly sure that is out as well.
Now, going to the heart of the matter.. I don't see the point of this in triggers or aliases. All of the needed parameters are accessable within the array of wildcards and being able to explicitly give names for them is not a major problem since you can simply create variables and assign them the values of the appropriate wildcards as the first thing you do in the sub or function. All that declaring them explicitly in the call does is add extra code to the triggers and aliases that don't do anything new.
I do still thinks that the callplugin syntax needs somethign like this, since you can't pass an array (Though I thought in all scripting an array 'must' be a varient contianing varients...) and only being able to pass one parameter means playing some real annoying games that shouldn't be needed, not the least being that you litterally can't link your own plugin to someone elses without adding code to their's that takes the data needed for a sub with 3+ parameters and dissects it out of a string before calling the real sub. This is counter productive, since you can't call the 'real' sub directly and you have to edit someone elses code. :p
So trying again I would suggest:
CallPluginEx BSTR ID, BSTR Routine, BSTR Arguement, BSTR Delimiter, Bool CallType
Where CallType = FALSE sends the arguement normally and CallType = TRUE takes the Arguement, splits it using the delimiter and constructs a multi-parameter call.
i.e.
CallPluginEx "SomeID", "Mysub", ",", "Fred,Bob", TRUE
would result in mushclient calling the sub as:
SomeID.Mysub("Fred","Bob")
This does not send or require any 'arrays' and makes a lot more sense than having to have someone add an entire sub to do the same thing into a plugin just to integrate it properly and which does essentially the same thing. I don't mind telling someone that 'If you want to set the colors from your own script/plugin in mine the syntax is Setcolor(Type, Color).' I do have a problem with forcing people to muck around in other peoples code to use the existing single arguement call method. ;) Seeing how something works is fine, but breaking it while trying to make such a change, then posting here with a request to fix it is something to avoid. lol | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,542 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top