Jump to content

Recommended Posts

Posted

$0 = InputBox("Configuration", "MOB / POP")
if $0 = "MOB" Then
    $1 = InputBox("MOB", "Enter MOB name.")
    $2 = InputBox("TOD", "Enter TOD.")
    IniWrite("C:\Track.ini", $1, $2 , $x)
ElseIf $0 = "POP" Then  
    $3 = InputBox("POP", "Enter MOB name.")
    $4 = IniRead("C:\Track.ini", $1, $2, "Not Found")
    MsgBox(0, "Pop time: ", $3)
Else 
    Exit
EndIf

It's a simple code to keep track of monsters killed in a game(FFXI), but it says i have to redefine $1 again...

Posted

Your $1 and $2 variables are defined inside the "MOB" section after "Then". So, if you enter the "POP" section, the "MOB" section never got executed, meaning the variables were never defined.

If you need $1 and $2 always defined, then you need to bring those two declarations to the top level, outside of the "MOB" section.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...