Yoko

All sides of Injection
It is currently 2025-11-10 16:11:34

All times are UTC+02:00




Post new topic  Reply to topic  [ 2 posts ] 
Author Message
 Post subject: fun with strings
PostPosted: 2006-07-06 17:07:21 
Offline

Joined: 2005-07-14 20:04:18
Posts: 8
I want to script the following:
A function should use the journal to check if my current target (lastattack) says something.
For example it could check if he says "Im coo".
So the basic check for it would look like this:

if uo.journal(0) == uo.getname("lastattack") + ": Im coo" then

The problem i discovered is that uo.getname returns the playername WITH guildname, however in journal the guildname is NOT displayed.
So when my target would really say "Im coo" the function would trigger as:

if "Player: Im coo" == "Player[guildname]: Im coo" then

which of course never works :/

So my question is: Is there..
1. ..another way to get the playername WITHOUT guildname?
2. ..some stuff to edit strings.. like cutting strings or comparing only parts of a string?

kthx


Top
   
 Post subject:
PostPosted: 2006-07-07 20:28:56 
Offline

Joined: 2005-07-14 20:04:18
Posts: 8
i finally found teh answer myself..
for those of you that care (:o) :
Code:
VAR strfullname = ""
VAR strrealname = ""
VAR irealname = 0
VAR i = 0
strfullname = uo.getname("lastattack")
for i=0 to Len(strfullname)
   if strfullname[i] == "[" then
      irealname = i-1
   endif
next
for i=0 to irealname
   strrealname = strrealname + strfullname[i]
next


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 2 posts ] 

All times are UTC+02:00


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited