|
rwfrk Wanderer
Joined: 26 Feb 2002 Posts: 81 Location: USA
|
Posted: Sun Oct 27, 2002 4:25 pm
Help with substitue |
I'd like to be able to automattically convert returned text such as sssseeees into 4s4es automatically ;)...thanks in advance
Zmud 616
W95 |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Oct 27, 2002 7:09 pm |
#VAR DirCount 0
#VAR LastDirection {}
#VAR WalkString {}
#VAR TempWalkString {}
#ALIAS ConvertWalk {DirCount=1;LastDirection="";TempWalkString="";#LOOP %len(@WalkString) {#IF (%copy(@WalkString,%i,1)=@LastDirection) {#ADD DirCount 1} {TempWalkString=%concat(@TempWalkString,%if(@DirCount>1,@DirCount),@LastDirection);DirCount=1;LastDirection=%copy(@WalkString,%i,1)}};WalkString=@TempWalkString}
To use just put what you want to convert into WalkString then call the alias. |
|
|
|
rwfrk Wanderer
Joined: 26 Feb 2002 Posts: 81 Location: USA
|
Posted: Sun Oct 27, 2002 8:42 pm |
Um...you can probbly guess this is for that guide bot you wrote ;)....any easy ways of doing this keeping that in mind..
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Mon Oct 28, 2002 1:16 am |
Guessed as much that is why I formatted it like I did, test it out with a few sample strings then if all is well in the !buy trigger make the following changes.
Before this line:
Teller=%concat(%1," Your path to ",%word(@Teller,1,"=")," is ",%word(@Teller,2,"=")," ",%item(@{@CompareTarget},1)," credits deducted.")
Add these 2 lines:
WalkString=%word(@Teller,2,"=")
ConvertWalk
Next change the teller= line above to:
Teller=%concat(%1," Your path to ",%word(@Teller,1,"=")," is ",@WalkString," ",%item(@{@CompareTarget},1)," credits deducted.") |
|
|
|
|
|
|
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 vote in polls in this forum
|
|