fun with strings
Posted: 2006-07-06 17:07:21
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
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