Switch Familiar script

muffins

Member
Okay, I have a functioning workaround script to do the same thing right now, but I was trying to simplify it based on map values instead of "if(my_name() == "username") { do this }"... but, this isn't working. I have two functions set up to define the ItemFam and StatFam, and they're called at the beginning of the switchFam function, but the variable isn't being recognized. I'm pretty sure I did things right, but... hrm. Would someone take a look at this please and help me realize what my brain is overlooking? :D
 

Attachments

  • testfam.ash
    1.7 KB · Views: 52
I modified the script, but don't remember all the changes. The most significant change was moving
Code:
familiar ItemFam = $familiar[none];
and
Code:
familiar StatFam = $familiar[none];
to the beginning of the script which put an end to this error:
Unknown variable 'ItemFam' (testfam.ash, line 51)
Unknown variable 'StatFam' (testfam.ash, line 54)
line numbers wont match what you saw for an error because I had already made some changes for testing.

output of attached script:
Best available item drop familiar: Coffee Pixie
Blood-Faced Volleyball true
Cheshire Bat false
Cymbal-Playing Monkey false
Hovering Sombrero true
Nervous Tick false
Best available stat gain familiar: Hovering Sombrero
Putting spunky not Skunky the Coffee Pixie back into terrarium...
Taking Wind take me away the Hovering Sombrero out of terrarium...
miniature gravy-covered maypole is better than (none).
Switching items...
Stealing miniature gravy-covered maypole from Coffee Pixie...
Putting on miniature gravy-covered maypole...
Equipment changed.

which I doubt is exactly what you want, but it's doing something.

heh Holatuwol beat me to it!
 

Attachments

  • testfam.ash
    2 KB · Views: 51

muffins

Member
I just moved the initial definitions to the top of the script, and it works perfectly!

Thanks, I'll have to keep this in mind next time I run into an undefined variable error. :)
 
Top