Unknown Identifier? =)

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
Cashcharac123
Newbie
Posts: 8
Joined: Tue Jan 03, 2006 7:32 am

Unknown Identifier? =)

Post by Cashcharac123 » Tue Jan 03, 2006 7:40 am

Edit: This is my first time working with more complex stuff in Macro Scheduler, so it might seem a bit sloppy...and probably a lot of unnecessary code, so if you happen to notice a lot of crap, please forgive me :).

Ask>Use Potions?,PotChoice
Ask>Use Shield?,ShieldChoice

IF>{PotChoice=YES AND ShieldChoice=YES}

This is part of the code I'm currently working with. Whenever I run the script it gives me the error "Unknown Identifier POTCHOICE". When I run the script as IF>Potchoice=YES, there is no error. I read through the help file and couldn't figure out what the problem was, according to the examples I was writing the code correctly. Any help would be appreciated.

Here is the full code below if it's needed:



VBStart
Function GetPotInfo

GetPotInfo = InputBox("Number of fights before pot use: ")

End Function

Function GetShieldInfo

GetShieldInfo = InputBox("Number of fights before shield use: ")

End Function
VBEnd


Ask>Use Potions?,PotChoice
Ask>Use Shield?,ShieldChoice

IF>{PotChoice=YES AND ShieldChoice=YES}

VBEval>GetPotInfo,PotQuestion
VBEval>GetShieldInfo,ShieldQuestion

wait>2
//Sets the Pot use timer, and shield timer to 0
Let>HPTPTime=0
Let>ShieldTime=0
goto>Start

//This part is for shielding yourself...like Asura's. Put your shield key on 5
//and go to town. Not necessary, but very helpful in keeping you alive
//if things happen to spawn upon you
Label>Shield
Send Character/Text>5
wait>1
Let>ShieldTime=0
goto>Start

//The Part where you heal is listed here
//Change the Send># to the hotkey you have set for potions
Label>PotTime
Send Character/Text>4
wait>1
Let>HPTPTime=0

goto>Start


//The targeting/fighting part is here
//Change the Send>#'s you have set for your attack/target hotkeys
//and the second wait># is how long you fight the monster before
//moving on to the next target. You can add more Send>'s if you
//want to use skills while fighting. HPTPTime=# is how many fights
//before the macro goes to use a potion, same with Shield, which
//goes to press 5, which is your damage shield...or whatever skill
//you want.
Label>Start
Send Character/Text>3
wait>1
Send Character/Text>1
wait>10
Let>HPTPTime=HPTPTime+1
Let>ShieldTime=ShieldTime+1
if>HPTPTime=%PotQuestion%,PotTime
if>ShieldTime=%ShieldQuestion%,Shield
goto>Start

endif




if>{PotChoice=YES AND ShieldChoice=NO}

VBEval>GetPotInfo,PotQuestion


wait>2
//Sets the Pot use timer, and shield timer to 0
Let>HPTPTime=0
//Let>ShieldTime=0
goto>Start2

//This part is for shielding yourself...like Asura's. Put your shield key on 5
//and go to town. Not necessary, but very helpful in keeping you alive
//if things happen to spawn upon you
//Label>Shield
//Send Character/Text>5
//wait>1
//Let>ShieldTime=0
//goto>Start

//The Part where you heal is listed here
//Change the Send># to the hotkey you have set for potions
Label>PotTime
Send Character/Text>4
wait>1
Let>HPTPTime=0

goto>Start2


//The targeting/fighting part is here
//Change the Send>#'s you have set for your attack/target hotkeys
//and the second wait># is how long you fight the monster before
//moving on to the next target. You can add more Send>'s if you
//want to use skills while fighting. HPTPTime=# is how many fights
//before the macro goes to use a potion, same with Shield, which
//goes to press 5, which is your damage shield...or whatever skill
//you want.
Label>Start2
Send Character/Text>3
wait>1
Send Character/Text>1
wait>10
Let>HPTPTime=HPTPTime+1
//Let>ShieldTime=ShieldTime+1
if>HPTPTime=%PotQuestion%,PotTime
//if>ShieldTime=%ShieldQuestion%,Shield
goto>Start2

endif

if>{PotChoice=NO and ShieldChoice=YES}
VBEval>GetShieldInfo,ShieldQuestion

wait>2
//Sets the Pot use timer, and shield timer to 0
//Let>HPTPTime=0
Let>ShieldTime=0
goto>Start3

//This part is for shielding yourself...like Asura's. Put your shield key on 5
//and go to town. Not necessary, but very helpful in keeping you alive
//if things happen to spawn upon you
Label>Shield
Send Character/Text>5
wait>1
Let>ShieldTime=0
goto>Start3

//The Part where you heal is listed here
//Change the Send># to the hotkey you have set for potions
//Label>PotTime
//Send Character/Text>4
//wait>1
//Let>HPTPTime=0

//goto>Start


//The targeting/fighting part is here
//Change the Send>#'s you have set for your attack/target hotkeys
//and the second wait># is how long you fight the monster before
//moving on to the next target. You can add more Send>'s if you
//want to use skills while fighting. HPTPTime=# is how many fights
//before the macro goes to use a potion, same with Shield, which
//goes to press 5, which is your damage shield...or whatever skill
//you want.
Label>Start3
Send Character/Text>3
wait>1
Send Character/Text>1
wait>10
//Let>HPTPTime=HPTPTime+1
Let>ShieldTime=ShieldTime+1
//if>HPTPTime=%PotQuestion%,PotTime
if>ShieldTime=%ShieldQuestion%,Shield
goto>Start3

endif

if>{PotChoice=NO and ShieldChoice=NO}

//Sets the Pot use timer, and shield timer to 0
//Let>HPTPTime=0
//Let>ShieldTime=0
goto>Start4

//This part is for shielding yourself...like Asura's. Put your shield key on 5
//and go to town. Not necessary, but very helpful in keeping you alive
//if things happen to spawn upon you
//Label>Shield
//Send Character/Text>5
//wait>1
//Let>ShieldTime=0
//goto>Start

//The Part where you heal is listed here
//Change the Send># to the hotkey you have set for potions
//Label>PotTime
//Send Character/Text>4
//wait>1
//Let>HPTPTime=0

//goto>Start


//The targeting/fighting part is here
//Change the Send>#'s you have set for your attack/target hotkeys
//and the second wait># is how long you fight the monster before
//moving on to the next target. You can add more Send>'s if you
//want to use skills while fighting. HPTPTime=# is how many fights
//before the macro goes to use a potion, same with Shield, which
//goes to press 5, which is your damage shield...or whatever skill
//you want.
Label>Start4
Send Character/Text>3
wait>1
Send Character/Text>1
wait>10
//Let>HPTPTime=HPTPTime+1
//Let>ShieldTime=ShieldTime+1
//if>HPTPTime=%PotQuestion%,PotTime
//if>ShieldTime=%ShieldQuestion%,Shield
goto>Start4

endif

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 03, 2006 7:55 am

Change it to:

IF>{%PotChoice%="YES" AND %ShieldChoice%="YES"}

Strings in Complex Expressions require quotes around them and variables within Complex Expressions need % symbols.

Read the first paragraph in the Complex Expressions topic in the help file:

"In Macro Scheduler all complex functions should be contained within curly braces ("{" and "}"). Variables should be enclosed within % symbols and literal strings should be enclosed within double quotes ("). Parameters are separated by commas (,). "
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Cashcharac123
Newbie
Posts: 8
Joined: Tue Jan 03, 2006 7:32 am

Post by Cashcharac123 » Tue Jan 03, 2006 8:59 am

Ask>Use Potions?,PotChoice
Ask>Use Shield?,ShieldChoice

IF>{%PotChoice%="YES" AND %ShieldChoice%="YES"}

I changed it to this and now have a new error:

Operator opAnd incompatible with String, says this twice...and then
Internal parser error. Code 10.

Any suggestions? =), I'm more lost than before...because now I have NO idea whats wrong.

BTW, thanks for the help Marcus :).

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 03, 2006 9:42 am

Sorry, my mistake. It should be this:

IF>{(%PotChoice%="YES") AND (%ShieldChoice%="YES")}

Note parentheses around each boolean expression.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Cashcharac123
Newbie
Posts: 8
Joined: Tue Jan 03, 2006 7:32 am

Post by Cashcharac123 » Tue Jan 03, 2006 10:00 am

Thanks so much! Works great now. All I have to do is add a few more small bits and my little macrobot will be complete ^^.

On another note, I was wondering if it was possible for Macro Scheduler to pick out colors on the screen and move the cursor towards them. I saw a few people using AutoIT to do this, and was hoping that it was possible with MS. Thanks again ^^.

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Jan 03, 2006 10:12 am

Hi,

Yes, use GetPixelColor if you want actual pixel colors. You can use this in a loop to check the color of each pixel on screen (or in a certain area) and move the mouse using MouseMove if the color matches the one you are seeking. This has been discussed before:

http://www.mjtnet.com/forum/viewtopic.php?t=885
http://www.mjtnet.com/forum/viewtopic.php?t=1363
http://www.mjtnet.com/forum/viewtopic.php?t=2470
http://www.mjtnet.com/forum/viewtopic.php?t=1864

... amongst others. Tip: Use the forum search function. Search link top of page.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Cashcharac123
Newbie
Posts: 8
Joined: Tue Jan 03, 2006 7:32 am

Post by Cashcharac123 » Tue Jan 10, 2006 11:28 am

Sorry for the long delay, was away for a few days. Anywayz, thanks a ton! =). The bot was finished and works quite nicely. I also want to thank you on behalf of all the players now benfitting from the bot. You were a great help and thanks to the success of this simple bot, I'm going to continue to advance my skills with MS and hopefully be as good as you one day ;). Expect to be hearing stupid questions from me in the future!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts