View unanswered posts | View active topics It is currently Sun Apr 19, 2026 11:37 pm



Reply to topic  [ 3 posts ] 
 WORKING ON A NEW SCRIPT PROJECT 
Author Message
Gameop
User avatar

Joined: Mon Jan 26, 2009 12:27 am
Posts: 123
Unread post WORKING ON A NEW SCRIPT PROJECT
Hi,

I'm working on a new project and I would like to do a GetCurrentline but if there are numbers or symbole like < ! or anything i would like to strip, how should I proceed... Do a big strip with each character... i pray that is not the way i need to do it...

Example of my script : my script take the $FIRSTNAME AND $LASTNAME.
But some players don't use a last name for their character, so the next word or characters after the name there is the <#34> or any player's serial in tw2002.
I Would like that my script take always the $FIRSTNAME and if it's not <#22>, take the $LASTNAME with a real last name "character's last name"...
So if you follow my though, I will be please to evict that situation : $FIRSTNAME = BOB $LASTNAME = <#22>
So when you do echo "Hi " & $FIRSTNAME & " " & $LASTNAME & "."
It's not written : Hi BOB <#22>. ....
i would like to have : Hi BOB.

Someone help me please.

_________________
Dodger known as Yop Solo, Sysop
twgsdodgerbbs.ath.cx
http://cyberquebec.ca/_layout/?uri=http://cyberquebec.ca/twgsdodgerbbs/


Thu Dec 17, 2009 12:07 am
Profile
Ambassador
User avatar

Joined: Mon Feb 09, 2004 3:00 am
Posts: 3141
Location: Kansas
Unread post Re: WORKING ON A NEW SCRIPT PROJECT
Yop_Solo wrote:
Hi,

I'm working on a new project and I would like to do a GetCurrentline but if there are numbers or symbole like < ! or anything i would like to strip, how should I proceed... Do a big strip with each character... i pray that is not the way i need to do it...

Example of my script : my script take the $FIRSTNAME AND $LASTNAME.
But some players don't use a last name for their character, so the next word or characters after the name there is the <#34> or any player's serial in tw2002.
I Would like that my script take always the $FIRSTNAME and if it's not <#22>, take the $LASTNAME with a real last name "character's last name"...
So if you follow my though, I will be please to evict that situation : $FIRSTNAME = BOB $LASTNAME = <#22>
So when you do echo "Hi " & $FIRSTNAME & " " & $LASTNAME & "."
It's not written : Hi BOB <#22>. ....
i would like to have : Hi BOB.

Someone help me please.


k, I am guessing that you are writing a script that is working in T-Edit directly with the user record. The following might work - not sure as I didn't test completely.

Code:
waitfor "Userfile record"
setTextLineTrigger userName :userName "<A> Name"
pause
:userName
cutText currentline $dirtyName 20 999
getword $dirtyName $temp 1
setVar $name ""
setVar $i 2
while ($temp <> 0)
    getword $dirtyName $temp $i
    getwordpos $temp $pos "(#"
    if ($pos > 0)
       setVar $temp 0
    else
      setVar $name $name & $temp & " "
    end
    add $i 1
end
echo ansi_12 $name


or maybe simply

Code:
waitfor "Userfile record"
setTextLineTrigger userName :userName "<A> Name"
pause
:userName
  getwordpos currentline $pos "(#"
  cutText currentline $name 22 ($pos - 22)
echo ansi_12 $name

_________________
               / Promethius / Enigma / Wolfen /

"A man who has no skills can be taught, a man who has no honor has nothing."


Thu Dec 17, 2009 1:46 am
Profile ICQ
Gameop
User avatar

Joined: Mon Jan 26, 2009 12:27 am
Posts: 123
Unread post Re: WORKING ON A NEW SCRIPT PROJECT
Thanks you, i will try that I give a feedback.

_________________
Dodger known as Yop Solo, Sysop
twgsdodgerbbs.ath.cx
http://cyberquebec.ca/_layout/?uri=http://cyberquebec.ca/twgsdodgerbbs/


Thu Dec 17, 2009 10:34 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 18 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 © 2000, 2002, 2005, 2007 phpBB Group.
Designed by wSTSoftware.