Page 1 of 1
subroutine?
Posted: Mon Jun 13, 2011 8:12 pm
by england20
hello guys, new to all this but starting to love it lol anyways..
i copied booyjuice's forage macro to a new file in the macros folder when i go to load it in-game i get the error message saying
"flow ran into another subroutine
forage.mac@20 (main): sub Main
the current macro has ended.
anything i am doing wrong or something i need to add?
please help! =)
Re: subroutine?
Posted: Tue Jun 14, 2011 2:56 pm
by england20
this is the macro im trying to use.
|yafm.mac
|
|Yet Another Forage Macro
|
|Ini File: yafm.ini
|
| 0 = destroy
| 1 = keep
|
|New foraged items are added to the ini file automatically and are kept by default.
||||||||||||||||||||
| Main
||||||||||||||||||||
sub Main
/cleanup
| Verify that we have the ability to forage.
/if (${Me.Skill[Forage]}==0) {
/echo You cannot forage, silly person!
/goto :Exit
}
:Forage
| Stand up. Can't forage while sitting.
/if (${Me.State.NotEqual[STAND]}) {
/stand
/delay 5
}
/delay 1s
| If we can forage then do so.
/if (${Me.AbilityReady[Forage]}) {
/doability forage
}
| If we successfully foraged something then take care of it.
/if (${Cursor.ID}) {
/call HandleItem
}
/goto :Forage
:Exit
/return
||||||||||||||||||||
| HandleItem
||||||||||||||||||||
sub HandleItem
/declare ItemSetting int local
/declare NotFound int local
/varset NotFound -1
| Look up this item in yafm.ini
/varset ItemSetting ${Ini[yafm.ini,ForageList,${Cursor.Name},${NotFound}]}
/delay 5
| If the item isn't in the .ini file then add it.
/if (${ItemSetting}==${NotFound}) {
/ini "yafm.ini" "ForageList" "${Cursor.Name}" "1"
/varset ItemSetting 1
}
| If we're keeping this item then stash it in our bags.
| Otherwise, just destroy it.
/if (${ItemSetting}==1) {
:LootIt
/autoinventory
/delay 5
/if (${Cursor.ID}) /goto :LootIt
} else {
/destroy
}
/return
/return
Re: subroutine?
Posted: Tue Jun 14, 2011 4:54 pm
by dont_know_at_all
Which is line 20?
Re: subroutine?
Posted: Tue Jun 14, 2011 5:43 pm
by england20
sorry I dont know what you mean exactly?
Re: subroutine?
Posted: Tue Jun 14, 2011 6:19 pm
by dont_know_at_all
Files are a set a characters. A special character known as carriage return indicates the end of a line. Your error occurred on the 20th line so I would like to know the characters between the 19th and 20th carriage returns.
Re: subroutine?
Posted: Tue Jun 14, 2011 6:43 pm
by england20
nevermind, I figured it out =)
again I appreciate the feedback!