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
➜ VBscript
➜ Why isn't my script working?
Why isn't my script working?
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Andala
(7 posts) Bio
|
Date
| Mon 21 Jan 2008 02:28 PM (UTC) Amended on Mon 21 Jan 2008 02:35 PM (UTC) by Andala
|
Message
| My friend gave me his system a longgg time ago for Aetolia, and I've been fiddling with it since. He's apparently never had any trouble with it, but from the moment I got it, I haven't been able to get the cures to work, or really.. any part of the script to work from what I can tell. I only know the very basics to writing scripts for VBscript, so I don't know if I'm leaving something off or what. It used to be that once one cure was set off, the rest would go off as well. But now it just doesn't seem to work at all. The triggers that send off to the variables work fine, but those aren't in the script, so.. that's not the problem.
Don't really know a good way to show what I'm doing wrong, so I'm just going to post the entire script here. Sorry for the lengthiness of this.
ETA: Just kidding. Scripts too long to post here so.. hrm. I'll upload it somewhere.
http://www2.evilshare.com/9a9423a6-1986-102b-aba1-0007e90cfb90 | Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #1 on Mon 21 Jan 2008 04:59 PM (UTC) |
Message
| I'm at work, and that page is blocked for me, and a few of these questions may be readily apparent when looking at the script. However, I do have a few basic questions for you before people go about trying to solve your problem, especially since it is a large enough script to exceed the 6000 character limit.
1) Have you set up any testing reports? Just spitting out the values of variables at key points throughout the script can help troubleshoot where something went wrong.
2) Was this originally a plugin or a script, as you have it? They interface in a slightly fashion, so there can be issues switching back and forth.
That's about it without actually taking a look at the script. Stupid site blocking software... can't even check gmail. |
It is much easier to fight for one's ideals than to live up to them. | Top |
|
Posted by
| Andala
(7 posts) Bio
|
Date
| Reply #2 on Mon 21 Jan 2008 09:46 PM (UTC) Amended on Mon 21 Jan 2008 09:47 PM (UTC) by Andala
|
Message
| It was always a script, to my knowledge.
And, I'm afraid I'm not too sure as to how to set up a testing report. I know what my system does right now.
For example, if this happens:
With disgust, you notice that your sweat glands begin
My trigger changes the variable for slickness like so:
if world.getvariable ("attack_detected") = "on" then
world.setvariable "Affliction_Slickness", "on"
world.note "Slickness on"
end if
And if I look at my variables, attack_detected is on, and affliction_slickness is on.
And that's as far as it goes.
In my script, what should happen is INJECT ANTISPASMADIC. To present an example of what's in the script, so you don't have to dig through all of it.. here's what pertains to just slickness with all the other stuff taken out.
sub pipehealing (strTriggerName, trig_line, arrWildCards)
Dim value, spell, slickness, aeon, asthma, bal_pipe, afflictions, sudorific, antispasmadic, demulcent
slickness = world.getvariable ("affliction_slickness")
aeon = world.getvariable ("affliction_aeon")
asthma = world.getvariable ("affliction_asthma")
bal_pipe = world.getvariable ("bal_pipe")
sudorific = world.getvariable ("pipe_sudorific")
antispasmadic = world.getvariable ("pipe_antispasmadic")
demulcent = world.getvariable ("pipe_demulcent")
For Each v In world.GetVariableList
afflictions = world.getvariable ("afflictions")
value = world.GetVariable (v)
If Left (v, 11) = "affliction_" Then
spell = Mid (v, 12)
If value = "on" Then
' get existing afflictions
slist = Split (afflictions, "|")
snew = lcase (trim (spell))
sfound = vbFalse
' check affliction not in list already
for each s in slist
if s = snew then sFound = vbTrue
next
' if there, show error, otherwise add to list
if sFound then
else
if afflictions = "" then
world.SetVariable "afflictions", snew
else
SetVariable "afflictions", world.GetVariable ("afflictions") & "|" & snew
end if
end if
End If
End If
Next
If asthma = "off" Then
if stunned = "off" then
if aeon = "on" then
world.sendpush "inject " & demulcent
exit sub
end if
For Each v In world.GetVariableList
value = world.GetVariable (v)
If Left (v, 11) = "affliction_" Then
spell = Mid (v, 12)
If value = "on" Then
Select Case spell
Case "slickness" world.send "inject " & antispasmadic
End Select
End If
End If
Next
End If
end if
end sub
That's with quite a bit inside pertaining to other afflictions and cures taken out.
Now.. things in my script that do work, when an affliction is "on", my status bar shows Afflictions: slickness, etc. That much of my script works for sure. And the very last part of my script.. which is a rat counter.. works too. Basically, everything from the autosipper to the autobasher doesn't work.
Hope that helps slightly. | Top |
|
Posted by
| Zeno
USA (2,871 posts) Bio
|
Date
| Reply #3 on Mon 21 Jan 2008 10:53 PM (UTC) |
Message
| Game->Trace Trigger.
If you have some triggers or the sort, turn that on to help debug what is going on. |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | Top |
|
Posted by
| Andala
(7 posts) Bio
|
Date
| Reply #4 on Tue 22 Jan 2008 01:08 AM (UTC) |
Message
| Hrm, well. I went through some of my triggers to see what was going on. My pipehealing seems to work as well. So it's just the salves/poultices and herbs/slices.
When I traced a trigger, it would match the trigger, but it wouldn't execute the trigger script. | Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #5 on Tue 22 Jan 2008 05:11 AM (UTC) |
Message
| Any chance you could copy a trigger for both the pipehealing and the salves from the trigger menu and post it here? Is the script not called at all, or is it just not working correctly? |
It is much easier to fight for one's ideals than to live up to them. | Top |
|
Posted by
| Andala
(7 posts) Bio
|
Date
| Reply #6 on Tue 22 Jan 2008 11:54 AM (UTC) Amended on Tue 22 Jan 2008 12:16 PM (UTC) by Andala
|
Message
| .... well. I just figured out what was wrong, I think.
Realized I didn't put a script routine to call for each trigger. I kinda feel dumb.
Is the only way to fix this just to go through all of my triggers and fill in which part of the script each calls?
And now comes a problem that is because I didn't write this script. There's a sub healing and a sub timerhealing. The only difference between the two is that the timer seems to be different. And I don't know when to put whichever one, though that may not be something y'all can help me with. What I do know is that on the triggers I've tested, when I try doing timerhealing, it says that there's a wrong number of arguments. I don't know if I just need to leave it alone or what. | Top |
|
Posted by
| Shaun Biggs
USA (644 posts) Bio
|
Date
| Reply #7 on Tue 22 Jan 2008 04:51 PM (UTC) |
Message
| The easiest way would be to poke the person who made the script and have him/her turn it into a plugin :p But yes, the best thing to do is go through each trigger and make sure it is calling the appropriate script. I find the quickest way for me to do this is by opening up the .mcl file with a text editor and just changing it manually, but that's personal preference.
The sub healing is meant to be called by triggers from how it is set up. The three arguments that it takes identify the trigger that called it, as well as the wildcards and such. The sub timerhealing seems like it is meant to be called from the command line, possibly... maybe. The two subs have too much overlapping code for my taste, I would have had them both call a separate function. The lack of commenting is also cause for confusion for me, since I am in no way familiar with Aetolia. |
It is much easier to fight for one's ideals than to live up to them. | Top |
|
Posted by
| Andala
(7 posts) Bio
|
Date
| Reply #8 on Wed 23 Jan 2008 12:14 AM (UTC) |
Message
| Alrighty.
Thanks so much for all the help. I really appreciate it. | 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.
30,158 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top