![]() |
Tokens...
Does anyone know how to make a code that will show as many tokens as made? An example...
NPC Code: How would I make the npc show just as many words as said? I have tried this next code to show the text you say up to a limit of five: NPC Code: But it wont say anything. I once saw the code, but it was on Doomsday, and that's gone. Anyone know it? |
use tokenscount to get the number of tokens and work from there
|
Wouldn't it be easier to use #e ?
|
Why use tokenize when you are displaying what the player said?
message #c; would make more sense to me. |
Quote:
|
Ok, I would use #c, but i want something a bit more, like, everything except the first word. Anyone get this? I already know what tokenscount is and all. Like, if i said "/moo Hello, my name is bob." the npc would say, "Hello, My name is Bob". Or if i said, "/moo It's a fine day out, isn't it?" it would say, "It's a fine day out, isn't it?" Something that would put as many tokens as words you say. What is the syntax/formula for that?
|
NPC Code: Didn't test it, but is that what your looking for? |
Re: Tokens...
Quote:
If it's a level NPC, then that code you said should just work fine. If it's a weapon, then it will not, as the NPC does not physically exist in the level for the message command to work, and you will want to use setplayerprop #c,(stuff); to change the player's chat. |
Well dusty, the code didn't work, but the syntax i saw on DoomsDay was very similar... and no, it's not in a weapon, just an NPC.
|
Quote:
As for Dusty's code: Dusty, when exactly is the string containing your chat text a string list? |
I think #e() is your problem.
|
Did Doomsday have a website? If so, I can get the script there. And Lance, you're wrong, it can't be 4 or more... just 4:o.
|
If you were a pretty good scripter, you'd figure it out yourself :-p
The simplest way would be to use #e, using the first token's length to deduce the second token's start index. |
Quote:
whats up with that n-1 thing anyhow? I would've figured that if it were to not work in any circumstances it just wouldn't work if the tokenscount was any less than the highest index of tokens being looked at... |
Quote:
Quote:
|
Quote:
|
Quote:
Out of curiosity, what do you need to use all of the tokens for? There are a variety of ways to get what you want, but they really depend on your application. |
Alright... what I'm trying to get is an npc that when you put a certain prefix such as "/moo" that it would show all the words after it on all the players' screens. Something like the Events Team thing on Babylon where when they they say "setevent2" that everything else appears on the top-left of the players' screens. Capiche? Again, does DoomsDay have a website?
|
Quote:
|
I knew it, just never used it I guess.
|
Quote:
Capiche? :grin: |
No script posting allowed, sorry, but Kai deleted mines.
|
Quote:
|
Mines was just as short.
|
osrs: pointless to use #T if you are using 5 as the startindex, as that forces you to have a space in front of it for the #e to cut it off, and then there's nothing left for the #T to trim.
|
Quote:
I don't know why i used #T since i put -1 as length too. My bad. |
ok here's an pre-alpha version lol might not work probably will tho
<removed> as i said i think this should work so copy it and try it...if not ur welcome to contact me and i'll fix it for you |
o.O im sorry cant read lol you want it to display everything except the first word well here:
<removed> this is better than using tokens because it'll let you use commas where as if u use tokenize and u say something like "hello, to myself" it'll only display "hello" hope this helps ;) |
Quote:
it's used so, say I say: /testTEST /test TEST strequals(#T(#e(5,-1,#c)),TEST) both instances would return true but well... I guess it does have some sort of relation with the 01, #T is trimming all spaces at the from and end of a string so #T( test ) = test #T ( 123) = 123, etc, most people just don't need to use it for the end part because they know to use -1, instead of say just guessing the length is going to be 100 then trimming it |
Zelph: Stop posting full scripts to solve people's problems. -_-
|
Quote:
I jus said that #T was really not needed there. x.x' |
Sorry Lance, as you have probably noticed, im new to posting on the forum, as i had my password changed and the forum password did not changed along with my account password. I never bothered to check the rules, which states no posting scripts that players can just copy and paste. So this is a apologize to all and hope you can all forgive me.
|
Quote:
|
| All times are GMT +2. The time now is 10:39 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.