Alright, I'm having a little trouble with this subroutine. Here's the Sub:
What it's supposed to do is: If the toggle is set to shoot, i'll set the toggle to "not shoot", unwield my bow, then wield a shield, blunt or cut, depending on the variable, and wield a dirk or whip, depending on the variable.
If the toggle is set to not shoot, it'll unwield the dirk or whip depending on the variable, unwield my shield, and wield my bow, Simple enough.
Here's what it actually does -
If the variable bowon = 1, then it'll do
but if the variable bowon = 0, then it'll do
Meaning, it tries to wield my whip each time when I turn shooting off, and it'll unwield my dirk each time when I turn shooting on, regardless of whether I'm supposed to wield/unwield the dirk or wield/unwield the bow.
Could anyone help me debug this?
Quote:
Sub bow_toggle (a,b,wildcard)
If bowon = "1" then
World.Note "NO SHOOTING"
bowon = "0"
World.Send "unwield " & bow
World.Send "wear "& bow
if weapon = "whip" then
World.Send "get " & whip & " from bag"
World.Send "wield " & whip
Elseif weapon = "dirk" then
World.Send "get " & whip & " from bag"
World.Send "wield " & whip
End If
If armor = "blunt" then
World.Send "get " & bshield & " from bag"
World.Send "wield " & bshield
Elseif armor = "cut" then
World.Send "get " & cshield & " from bag"
World.Send "wield " & cshield
End If
Elseif bowon = "0" then
World.Note "SHOOTING"
bowon = "1"
If weapon = "whip" then
World.Send "unwield " & whip
World.Send "put " & whip & " in bag"
Elseif weapon = "dirk" then
World.Send "unwield " & dirk
End If
If armor = "blunt" then
World.Send "unwield " & bshield
World.Send "put " & bshield & " in bag"
Elseif armor = "cut" then
World.Send "unwield " & cshield
World.Send "put " & cshield & " in bag"
End if
World.Send "remove " & bow
World.Send "wield " & bow
End if
End SubWhat it's supposed to do is: If the toggle is set to shoot, i'll set the toggle to "not shoot", unwield my bow, then wield a shield, blunt or cut, depending on the variable, and wield a dirk or whip, depending on the variable.
If the toggle is set to not shoot, it'll unwield the dirk or whip depending on the variable, unwield my shield, and wield my bow, Simple enough.
Here's what it actually does -
If the variable bowon = 1, then it'll do
Quote:
NO SHOOTING
unwield darkbow59678
wear darkbow59678
get whip244566 from bag
wield whip244566
get shield186377 from bag
wield shield186377
NO SHOOTING
unwield darkbow59678
wear darkbow59678
get whip244566 from bag
wield whip244566
get shield186377 from bag
wield shield186377
but if the variable bowon = 0, then it'll do
Quote:
SHOOTING
unwield dirk261597
unwield shield186377
put shield186377 in bag
remove darkbow59678
wield darkbow59678
SHOOTING
unwield dirk261597
unwield shield186377
put shield186377 in bag
remove darkbow59678
wield darkbow59678
Meaning, it tries to wield my whip each time when I turn shooting off, and it'll unwield my dirk each time when I turn shooting on, regardless of whether I'm supposed to wield/unwield the dirk or wield/unwield the bow.
Could anyone help me debug this?