• You've discovered RedGuides, an EverQuest multi-boxing and scripting community 🧙‍♀️⚙️. We want you to play several EQ characters at once, come join us and say hello! 👋

  • A TLP without truebox has thawed (Very Vanilla ready)
    Frostreaver

Question - Trying to find out if I have a mission

Joined
May 21, 2014
RedCents
994¢
I'm trying to set up a subroutine to check if I still have a mission. I'm trying to improve my Freeport faction macro, so it knows when to go back to Tacots. Here is the code I'm trying to use and the error it is returning.


Rich (BB code):
	/declare mission string local "Giants in the Desert"
	/declare havemission bool local FALSE
Sub Main

	/if (${Bool[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}] && ${mission}}) {
			/varset ${havemission} TRUE
		/echo "We have to kill giants"
	} else {
			/varset ${havemission} FALSE
		/echo "No mission"
	}

/return


Error


Rich (BB code):
[2015/09/15 17:03:29] Unmatched bracket or invalid character following bracket found in index: ''

[2015/09/15 17:03:29] mission.mac@7 (Main): /if (${Bool[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}] && ${mission}}) {

[2015/09/15 17:03:29] /varset failed, variable 'NULL' not found

[2015/09/15 17:03:29] mission.mac@11 (Main): /varset ${havemission} FALSE

[2015/09/15 17:03:29] [MQ2] "No mission"

[2015/09/15 17:03:29] The current macro has ended.

Any help would be greatly appreciated.
 
Rich (BB code):
	/declare mission string local "Giants in the Desert"
	/declare havemission bool local FALSE
Sub Main

	/if (${Bool[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}]} && ${mission}) {
			/varset ${havemission} TRUE
		/echo "We have to kill giants"
	} else {
			/varset ${havemission} FALSE
		/echo "No mission"
	}

/return

Your missing bracket is marked in red, just before the && in the /if command line. That should? fix the rest of the error. If you use notepad++ for your macro writing you can set the curser next to each bracket and its match will turn red. I know it saves me a lot of trouble when checking complex lines of code.

Noticed just as posted you have an extra bracket at the end of ${Mission}. Did I mention getting all the code marks and brackets just right is hard...

By the way, if you plan on using the variable havemission in other parts of your macro it needs to be declared outer instead of local, but I expect you already know that.
 
I am wanting to use it to break out of the hunting section to make the toon go back to Tacots. I really thank you for your help, this is the first time I have tried to use a bool, and I couldn't figure out where to put the brackets for bool. I spent a day and a half trying to figure it out on my own, before asking for help, lol. I dropped out the varsets and declares as I only need to see if he has a mission. I may add back in more checks later.
 
Your already doing more then me. I didn't even know bool could be used that way. Basically you just have to close every bracket you open, but when you get something like that bool it gets confusing. I love writing my own macros and am not ashamed to steal good or interesting code anywhere I find it. I wrote my own version of kissassit just so I would know exactly what was going on in each line of code. Mine is more specialized for the group and classes I usually run, but still fun to make.
 
That is far beyond my abilities at this point, lol.

I ran into another error when I tried to include the bool statement into my macro. This is going to drive me crazy, lol.

Error:

Rich (BB code):
[2015/09/15 19:27:34] Failed to parse /if command.  Could not find command to execute.

[2015/09/15 19:27:34] EasyBotB.mac@154 (Main): /if ((${Bool[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}]}){

[2015/09/15 19:27:34] The current macro has ended.

[2015/09/15 19:27:34] Usage: /if (<conditions>) <command>

Code referenced:

Rich (BB code):
	/if ((${Bool[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}]}){
|			/squelch /target clear
				/goto :MainLoop
		} else {
				/echo Task Complete!!!
			/squelch /target clear
				/call Movement 3 5		
		}
			/goto :start		
	}
/return
 
In the code you reference you have 2 left brackets (( and only 1 right bracket ) I think it should be /if (${Bool[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}]}){

Someone in another post did a setup file for notepad++ it will help you keep track of your brackets braces and what not
 
I got that fixed by adding a space in front of the { at the end of the line. There are <command> and else statements below that. I'll look into the Notepad++ setup thread. Thanks for your help.

- - - Updated - - -

I'm now trying to verify if I have the correct mission. The way it is written, if you have another mission it runs through the mac (reports having mission even if not the correct mission). I'm asking help in coding the second part of the evaluation to specify the correct mission.

Rich (BB code):
	/declare Mission string outer Giants of the Desert

Sub Main


	/if (${Bool[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}]} && ${Mission})  {
			/echo "I have a Giant mission!"
			} else {
		/echo I don't have a Giant mission!!!
		}
/return
 
Wonder if you could do something like

Rich (BB code):
	/if (${String[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}].Equal[${Mission}]})

The spelling and even the spacing of the /declare would have to exactly what is found in the task window, but it should work, maybe.

actually try typing /echo ${String[${Window[TaskWnd].Child[TASK_TaskList].List[1,2]}]} while in game and see what the result is.

Then you could add the .Equal[echo result] part in your macro avoiding the use of the variable, unless you want the variable for future different missions.
 
Question - Trying to find out if I have a mission

Users who are viewing this thread

Back
Top
Cart