Need Help Writing sub using strings

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

Moderator: MacroQuest Developers

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Need Help Writing sub using strings

Post by Neolesh » Tue Aug 24, 2004 3:21 pm

Basically I need a sub that will do the following..

Code: Select all

Sub DefendMyBot

    /tar NPC radius 75
    /delay 2
    /assist
    /if Current target = "my bot" {
    /call KillMob
    }

/return
The problem I'm having is with

/if Current target = "my bot" {

I still haven't learned this code, I'm trying to find it in the documentation but it's slow going, still kinda slow at it.
Last edited by Neolesh on Tue Aug 24, 2004 3:28 pm, edited 1 time in total.

User avatar
Night Hawk
a grimling bloodguard
a grimling bloodguard
Posts: 590
Joined: Fri Aug 13, 2004 4:56 pm

Post by Night Hawk » Tue Aug 24, 2004 3:26 pm

Code: Select all

/if (${String[${Target.CleanName}].Equal["an elvis offspring"]})

Neolesh
a hill giant
a hill giant
Posts: 231
Joined: Mon Aug 23, 2004 11:15 am

Post by Neolesh » Tue Aug 24, 2004 3:28 pm

Oo Thank you for very quick response =)

Edit: ahh yes working perfectly :)

dman
a hill giant
a hill giant
Posts: 181
Joined: Fri Dec 05, 2003 12:54 pm

Post by dman » Wed Aug 25, 2004 6:39 pm

Just a note ${Target.CleanName} is already a string so this works just as well and less brackets to worry about.

Code: Select all

/if (${Target.CleanName.Equal["an elvis offspring"]})

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

Top Product Guide

Post by FrankJScott » Thu Oct 26, 2023 12:59 pm

Please try Google for Cool Product Tips ec9a89a

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

Excellent Workspace Management And Moving Solutions Info

Post by FrankJScott » Tue Aug 12, 2025 2:44 pm

why not just google it