Still can't get included macros to work :/

Need some help with that macro you're working on or aren't quite sure how to get your macro to do something? Ask here!

Moderator: MacroQuest Developers

Guest

Still can't get included macros to work :/

Post by Guest » Thu Nov 20, 2003 4:39 am

Each time i do #include filename.mac i get this error when it tries to call to call the included mac..
it used to work, but some time ago it got borked, i dont remember when exactly tho..

when i try to use this one for example:

Code: Select all

#include spellcast.mac 

sub Main 
  /call Cast "@Param0" 
/return 
i get this error

Code: Select all

Ending macro: Subrutine Cast wasn't found
test.mac@4 (Main): /call cast "@Param0"
Cleared the following: Timers Vars Arrays
The current macro has ended.
Here is the spellcast.mac

Code: Select all

|Plazmic + 1 line change by Imperfect 

|** SpellCast.inc 
** This will cast a spell reliably for you... 
** Usage: 
** /call Cast "spellname" 
** It will return the following values: 
** CAST_SUCCESS 
** CAST_UNKNOWNSPELL 
** CAST_OUTOFMANA 
** CAST_OUTOFRANGE 
** CAST_CANNOTSEE 
** CAST_STUNNED 
** CAST_RESISTED 
** 
** New Vars Modification 
** Plazmic's no globals needed version 
**| 

|Oct 9, 2003 - Updated to work with new vars and $char(casting) - gf 
|Oct 11, 2003 - switched some logic, removed defines - gf 


#event Fizzle "Your spell fizzles!" 
#event Interrupt "Your casting has been interrupted!" 
#event Interrupt "Your spell is interrupted." 
#event Recover "You haven't recovered yet..." 
#event Recover "Spell recovery time not yet met." 
#event Resisted "You target resisted the " 
#event OutOfMana "Insufficient Mana to cast this spell!" 
#event OutOfRange "Your target is out of range, get closer!" 
#event NoLOS "You cannot see your target." 
#event Stunned "You cannot cast while stunned" 
#event Standing "You must be standing to cast a spell" 
#event Collapse "Your gate is too unstable, and collapses." 

Sub Cast(SpellName) 
  /if n $char(gem,"@SpellName")==0 /return CAST_UNKNOWNSPELL 
  :StartCast 
  /call ClearReturnValue 
  /if n $char(gem,"@SpellName")<0 { 
     /delay 0 
     /goto :StartCast 
  } 
  /cast "@SpellName" 

  :WaitCast 
     /if "$char(casting)"=="TRUE" { 
       /delay 1 
       /goto :WaitCast 
     } 
     /doevents Fizzle 
     /doevents Interrupt 
     /doevents Recover 
     /doevents Standing 
     /doevents OutOfRange 
     /doevents OutOfMana 
     /doevents NoLOS 
     /doevents Resisted 
     /if "$return"=="CAST_RESTART" /goto :StartCast 
     /if "$return"!="CAST_SUCCESS" /return "$return" 
/return CAST_SUCCESS 

Sub ClearReturnValue 
/return CAST_SUCCESS 

Sub Event_Fizzle 
/return CAST_RESTART 

Sub Event_Interrupt 
/return CAST_RESTART 

Sub Event_Recover 
   /delay 5 
/return CAST_RESTART 

Sub Event_Standing 
   /stand 
/return CAST_RESTART 

Sub Event_Collapse 
/return CAST_RESTART 

Sub Event_OutOfMana 
/return CAST_OUTOFMANA 

Sub Event_OutOfRange 
/return CAST_OUTOFRANGE 

Sub Event_NoLOS 
/return CAST_CANNOTSEE 

Sub Event_Stunned 
/return CAST_STUNNED 

Sub Event_Resisted 
/return CAST_RESISTED 
and the .ini file

Code: Select all

[MacroQuest]
MacroPath=.\macros
LogPath=.\logs
DebugSpewToFile=0
FilterSkills=0
FilterTarget=0
FilterMoney=0
FilterFood=0
FilterMacro=0
FilterEncumber=0
FilterDebug=0
KeepKeys=1
UseMQChatWnd=0
ForegroundMaxFPS=50

[Telnet Server]
Enabled=0
LocalOnly=0
Port=0
Welcome=MacroQuest telnet server
Password=macroquest

[Aliases]
/exp=/echo $char(exp)% experience...
/bind=/doability "Bind Wound"
/gmlist=/who all gm
/mana=/echo Current Mana: $char(mana,cur) -- Max Mana: $char(mana,max)
/hp=/echo Current Health: $char(hp,cur) -- Max Health: $char(hp,max)
/mousepos=/echo Your mouse is at $mouse(X) , $mouse(Y)
Everything is installed on W:\MQ, i have tried it with C:\MQ aswell, in case there would be some issues with networked drives, no difference tho.
As far i can see MQ somehow doesnt find the included macro's, but it has no problems loading the "main" macro from the same directory however.

Any clues why this is happening ?

ohh yea.. i compiled it with .NET.

apart from this somehow annoying issue, i love this program :)

Guest

Post by Guest » Thu Nov 20, 2003 6:15 am

prolly wont fix the problem but try compiling the newest version?

I know there is also something with the syntax but I cant oput my finger on it :P[/code]

Scrime
a ghoul
a ghoul
Posts: 86
Joined: Sun Sep 21, 2003 5:48 pm
Contact:

Post by Scrime » Thu Nov 20, 2003 7:58 am

Try changing the multi-line comments to single line comments.
[url=http://www.catb.org/~esr/faqs/smart-questions.html]asking smart questions[/url]

Guest

Post by Guest » Fri Nov 21, 2003 8:37 am

It should be a fairly new version, was downloaded and compiled 2-3 days ago, so version should be fairly new.

The multi file comments are made by hehe Plazmic himself, anyways, if that will do the trick, yay :)
will try as soon i get home )

chimaera
a lesser mummy
a lesser mummy
Posts: 37
Joined: Fri Aug 01, 2003 4:14 pm

Post by chimaera » Fri Nov 21, 2003 8:55 am

change

Code: Select all

#include spellcast.mac
to

Code: Select all

#include spellcast.inc
Edit: Thats if you have used Plazmic's name for the spellcast i mean. If not, that wont solve it..

Guest

Post by Guest » Fri Nov 21, 2003 1:36 pm

Got it to work now.. Thanks Scrime for the solution, removing the multi lined comments made the trick.. )