Targeting someone based on a string holding their name

Need help with a macro you are writing? Ask here!

Moderator: MacroQuest Developers

Dregs
orc pawn
orc pawn
Posts: 20
Joined: Tue Dec 29, 2009 9:57 am

Targeting someone based on a string holding their name

Post by Dregs » Sat Mar 06, 2010 12:47 am

I was having trouble with a macro I was working on which was a bit more complicated, so I made this simpler version to try to sort out where the problem is coming from, but I'm having a heck of a time finding the cause of the problem.

I even tried copying parts from existing (supposedly working) macros, but I still get the same problem.

Here is the macro.

Code: Select all

#include spell_routines.inc

#Event Haste "#1# tells you, 'haste me'" 

Sub Main
/echo HasteBot macro started
   :MainLoop
   /doevents   
   /goto :MainLoop
/return

Sub Event_Haste(Line,Teller)
   /tar ${Teller}
   /delay 2s
   /call Cast "Speed of Ellowind" gem5 10s
   /squelch /target clear
   /echo String Teller is set as "${Teller}"
/return
The /echo part is to see if I had a problem with the stored name. (Jany is not the real name of my toon, and also, the quotation marks are to check if maybe I had a space included in the string) However, the output looks like this:
[MQ2] HasteBot Macro Started
There are no spawns matching: (0-100) any jany
[MQ2] String Teller is set as "Jany"
If anyone can give me some insight into getting this to work, it would be much appreciated.

el_nene
a snow griffon
a snow griffon
Posts: 354
Joined: Tue Nov 02, 2004 1:28 pm

Re: Targeting someone based on a string holding their name

Post by el_nene » Sat Mar 06, 2010 6:27 am

Code: Select all

Sub Event_Haste(Line,Teller)
   /if (${Teller.Left[1].Compare[ ]}<0) /varset Teller ${Teller.Right[-2].Left[-1]}
   /tar ${Teller}
   /delay 2s
   /call Cast "Speed of Ellowind" gem5 10s
   /squelch /target clear
   /echo String Teller is set as "${Teller}"
/return
Try that.

Dregs
orc pawn
orc pawn
Posts: 20
Joined: Tue Dec 29, 2009 9:57 am

Re: Targeting someone based on a string holding their name

Post by Dregs » Mon Mar 08, 2010 7:56 pm

Thanks so much. I haven't actually tested it yet, but will do so when I get home. I know it's a lot to ask. If you could, though, would you mind explaining what that's doing? I'm not so familiar with the usage of the .Left and .Right. Is that referring to the characters in the string?

User avatar
ieatacid
Developer
Developer
Posts: 2727
Joined: Wed Sep 03, 2003 7:44 pm

Re: Targeting someone based on a string holding their name

Post by ieatacid » Mon Mar 08, 2010 9:28 pm

It's to remove the extra characters that make names into links.

Dregs
orc pawn
orc pawn
Posts: 20
Joined: Tue Dec 29, 2009 9:57 am

Re: Targeting someone based on a string holding their name

Post by Dregs » Wed Mar 10, 2010 9:24 pm

Ahh, okay. Well, thanks so much for the how-to! I really appreciate it.

FrankJScott
naggy
naggy
Posts: 2354
Joined: Sun Feb 19, 2023 7:11 am

Go To The Website For Great Mastiff Breed Info

Post by FrankJScott » Sun Feb 26, 2023 5:15 am

To the people asking about top neapolitan mastiff breeders, click for Boerboel South African Mastiff breed, mastiff dog kennel, blonde mastiff, Kangal Turkish Mastiff breed great advice, italian master dog, I highly recommend this read what he said for awesome mastiff breed tips or bullmastiff neapolitan, french mastiff aggressive, Bully Kutta Pakistani Mastiff breed see recommendation, read this, cane corso bull mastiff, siberian mastiff cost, on top of this on front page for updated mastiff dog blog as well as cane corso blonde, see this Dogo Argentino breed, mastador breeders, paul mastiff dog, mastiffmaster.com Tibetan mastiff breed, American Mastiff breed home page, alongside all this sell for new mastiff breed link and don't forget bull mastiff training, neapolitan mastiff aggressive, why is my dog's skin so loose tips, biggest bullmastiff, Dogo Argentino breed great advice, labrador mastiff, not to mention this discover more for top mastiff breed site bull.mastiff, english mastweiler, mastiffmaster.com Iranian Sarabi Mastiff, picture of a bullmastiff, english mastiff for adoption near me, bull mastiff adoption, not to mention this good for best mastiff dog forum and don't forget mastiff himalayan, American Mastiff breed report, Spanish mastiff breed see advice, bullmastiff price, try this bullmastiff breed, english mastiff cane corso mix, and don't forget learn more here for new mastiff dog details which is also worth a look. I also recommend this read full report for top mastiff breed advice as well as royal mastiff, dog breed with loose skin tips, how big do french mastiffs get, saggy dog face tips, tibetan mastiff for sale, owning a mastiff, on top of this here are the findings for good mastiff dog link alongside all best mastiff breeds home page, Spanish mastiff breed see info, Dogue De Bordeaux breed site, different mastiffs, Cane Corso breed best recommendation, brazilian mastiff aggressive, not to mention see post for updated mastiff breed blog not to mention look at the Bully Kutta Pakistani Mastiff breed, english bulldog memes, Dogue De Bordeaux breed, see this mastiff story viewer, best puppy food for mastiffs, amerikansk mastiff, which is also great. Finally, have a look at this her comment is here for high rated mastiff dog advice with why do dogs have extra skin on their neck, rhodesian mastiff, top 10 mastiff dog breeds, click for best mastiff breeds, Cane Corso breed best tips, Pyrenean Mastiff great recommendation, for good measure. Check more @ Read Full Article For Best Mastiff Breed Info d1ac71_