|
dorien Newbie
Joined: 21 Oct 2013 Posts: 3
|
Posted: Wed Oct 23, 2013 11:23 am
simplest VBS help |
hi i have some issue about using vbs
have trigger pattern ^You say: (*)
and VBscript :
MsgBox(%1)
i tried different things like zs.apram(1) and trying name that value. any1 have ideas how to sort this out? |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Wed Oct 23, 2013 4:38 pm |
As far as I can tell (I've tested pretty extensively in the past) there's no way to access parameters in VBScript. The best workaround I could find was to first assign the parameter to a variable (in zScript), then either call a VBScript alias or use #MSS to run your VBScript code, referencing the variable with zvar.varname.
|
|
|
|
khil Beginner
Joined: 18 Dec 2010 Posts: 17
|
Posted: Tue Oct 29, 2013 1:00 am |
I will shamelessly bump it, as we still muddle through some problems with ZMUD version of it....
The trigger:
Code: |
^You killed* (%w).$ |
Code: |
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
oXMLHTTP.Open "GET", "http://guildsite.coml/name/%1", False
oXMLHTTP.Send |
... works flawlessly when build on pure MSScript. Meaning the #SS there is getting tha parameter %1 in pure form. Our surprise was endless.
Now, we are working on a more complicated script, that processes few values and attempt to send the result (digits) to the server
Code: |
blablalba
blalblabl
blblala
@finalvalue
#MSS {Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
oXMLHTTP.Open "GET", "http://guildsite.com/name/"&@finalvalue, False
oXMLHTTP.Send} |
This does not work properly.
While the same with #SS does (obviously though it is not parsing or grabbing any values from zscript above, as it is supposed to)
Where is the difference between #MSS and #SS?
Next, we tried simple alias with same code as the first trigger
Code: |
Set oXMLHTTP = CreateObject("MSXML2.XMLHTTP.3.0")
oXMLHTTP.Open "GET", "http://guildsite.coml/name/%1", False
oXMLHTTP.Send |
sends it beautifully to the server
sends 0, regardless of variables value.... and i tried every possible way of expanding it i could think off. I just spend 6 hours trying to get it work, and while the solution seemed to be just round the corner all the time, now it looks like this is Mission Impossible.
Possible other solutions:
- using WGET - but far far from perfect
- writing whole script from scratch i VB - which none of us knows really. I will post it here in vain hope that somebody can quickly guide me trough how VBS equivalent of zscript of this would look like
Trigger
Code: |
^You have gained ({one|two|three|four|five}) levels since loggin on.$ |
Code: |
#if %ismember( %1, "one|two|three|four|five")=<@oldlevel {} {
newtime = %eval( (%time( hh)*3600+%time( nn)*60+%time( ss)))
timetolevel = @newtime-@oldtime
#var oldlevel {%ismember( %1, "one|two|three|four|five")}
#echo {%cr%ansi( green)---- NEW LEVEL AFTER %eval( @timetolevel/60) minutes! ----%cr}
oldtime = @newtime
|
The 2 variables existing outside of script are of course @oldlevel and @oldtime |
|
|
|
khil Beginner
Joined: 18 Dec 2010 Posts: 17
|
Posted: Tue Oct 29, 2013 9:16 am |
Well I am kinda moron. Since it cannot be done, I just setup the zscript trigger to do #show OMFG @result.
and VB trigger tu pick pattern " ^OMFG (*)." |
|
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|