Can't get something This to work

Posted by David B on Thu 27 Feb 2003 02:30 PM — 3 posts, 15,687 views.

USA #0
The script:

sub SpamCast(name, output, wilds)
dim count
for count = 1 to 10
world.send "c " & world.getvariable("SpellName")
next
world.send world.getvariable ("Sleeper")
world.send "inventory"
end sub

Works perfect, like a charm.

Wanna change it to:

sub SpamCast(name, output, wilds)
dim count
for count = world.getvariable ("spellcount")
world.send "c " & world.getvariable("SpellName")
next
world.send world.getvariable ("Sleeper")
world.send "inventory"
end sub

I setup an alias:
Alias: spellcount (*)
Checked: Enabled, Ignore Case
label: SpellCount
script: SpellCount

sub SpellCount (name, line, wilds)
world.setvariable "SpellCount", wilds (1)
end sub

For somereason its not working :( I'm doing soemthing wrong and I'm not quite sure what it is.
USA #1
>>>>for count = world.getvariable ("spellcount")<<<

What are you starting at? This will only do it once, since you fail to specify 'start TO end' and assumes that spellcount is both the start and end. Change it to:

for count = 1 to world.getvariable ("spellcount")
Russia #2
Maybe it would be safer to do:

for count = 1 to cint(world.getvariable("spellcount"))

At least I never trust VB to make those sorts of decisions *shrug*