Here is the script that I am trying to use right now. It doesn't work and I'd like you guys to take a look at it. I've had some experience scripting in Unix, but this has got me boggled. I'll post the code and explain what I need it to do.. The parts that I've left un-commented are part of a rolling script. It checks the 'roll' (the wildcard) against a number (51 in this case) and decides if it supposed to roll or stop rolling. I've got that part worked out. Now, I'll explain the problems I do have with the code.
I think that my code is sound.. I just don't know what syntax I need. Trust me when I tell you all that I've looked around. All I can find, though, are twenty page examples or every single function I don't need. Go ahead and reply as you like, but try to give me exact solutions to my three problem spots. If you want to send me to some basic vbScript site that has what I'm looking for, that would be great too. Thanks, Matt.
sub OnRoll (name, line, wildcards)
dim roll
dim max 'I'm unsure about this... This is the variable that I'm trying to initalize.
Do I need to initalize it in some special way?
roll = CInt (wildcards (1))
max = 0 'Here is an uncertianty that I brought over from unix. I want the
variable to be reset to keep other 'max roll' values from carrying
over. I'm not entirely sure how to do it in vb, though. My first
problem.
if roll < 51 then
world.send "roll"
else
world.EnableTrigger "LblRoll", 0
world.Sound "***some wav sound***"
end if
if roll > max then 'Here is where I check the max.
max = roll 'Here, I want the max to be set equal to the roll if the roll is
greater. Keeping a running record of the maximum roll. I don't
think that it works like the variable stuff in unix so this is
my second problem.
world.note "Max roll =", max 'Here is the note to the world. I can get the text
into the output all right, I just can't figure
out how to 'print' the variable like in unix. My
third problem.
else
world.note "Max roll =", max 'Here it prints if the max isn't beat.
end if
end subI think that my code is sound.. I just don't know what syntax I need. Trust me when I tell you all that I've looked around. All I can find, though, are twenty page examples or every single function I don't need. Go ahead and reply as you like, but try to give me exact solutions to my three problem spots. If you want to send me to some basic vbScript site that has what I'm looking for, that would be great too. Thanks, Matt.