Post Reply Home » Forums » EverQuest 2 » EverQuest 2 Premium Discussions

Question for vbscript programmer : EverQuest 2 Premium Discussions

Posted: November 13th, 2005, 10:33 am
slam666

Total Posts: 1184
Joined: April 21st, 2005, 7:30 am
User avatar
Hi,

I have a quick question for vbscript programmers.

I want to check for a string within a string and I want to check for the expression 's

So if 's is include in the string

I am using this

i = InStr(CStr(s), CStr(token))

s is my string and token is the string i am trying to check if it is inside the string

so can i just do token="'s" or do I need to put a special char before the '

Ex: a Steelcrown harasser's Gouge hits YOU
I wanna see if there is a 's in the string



Thanks.
Posted: November 14th, 2005, 6:57 pm
tault_discoduck
can't answer your question directly- but let me ask this: are you trying to determine if a mob is a pet?

I ask for 2 reasons: first, just checking for 's could produce some false positives. Second, I don't know if the current version of the service supports it, but there is a more elegant way to do this: mob data includes a bitflag indicating wether or not its a pet. If its not listed, you might pettition Wyv to add it.
Posted: November 15th, 2005, 3:47 am
slam666

Total Posts: 1184
Joined: April 21st, 2005, 7:30 am
User avatar
No I am trying to find if my healer bot is getting hit for real or if he just getting hit by area spells

And I found my answer

Thanks
Posted: November 17th, 2005, 8:41 am
turnball
Yea you have it right. To check for an apostrophy within a string you can just use double quotes around the apostrophy. So if you had

s = <main string>
token = <the characters you are searching for>


So
if InStr(CStr(s), CStr(token)) then ' would return true and jump into the if block if it were present.

The value of tocken would be
token = "'s"

Hehe and disregard the private mesage I sent you. Its pay day and I figured I would just pay for the service ;) Now to get them to give me some extensions for free. I really wanted to get into the macros and bots to author some :D
Want Advertisements After The Last Post Removed? Create A Free Account!
blue large dotWho is online
Users browsing this forum: Bing [Bot], Google [Bot] and 19 guests
Post Reply