ID:149905
 
Im smaking a thing just like s_smiles but i cant get it to filter numbers. It will only work on letters and thats giving my trouble too. why cant it replace text?
alright i wiated a day its not like i put it on 5 min's ago but i realy need this ? answered.
In response to Scoobert
Scoobert wrote:
alright i wiated a day its not like i put it on 5 min's ago but i realy need this ? answered.

Maybe it would help if we knew what you were asking. Your question is sort of a non-sequitir. Please explain in detail.

Lummox JR
In response to Lummox JR
ok i makeing a card game, and when you hit draw it makes a random number from 1-14 showing each card of one color. Wheat im trying to do is make it do that when you click deal and it shows you (in the text area) what card you have you see a pic reather than the number. I cant get it to filter for numbers i can only get it to filter letters.
In response to Scoobert
Scoobert wrote:
ok i makeing a card game, and when you hit draw it makes a random number from 1-14 showing each card of one color. Wheat im trying to do is make it do that when you click deal and it shows you (in the text area) what card you have you see a pic reather than the number. I cant get it to filter for numbers i can only get it to filter letters.

I really have no idea what you mean by "filter for numbers". Filter what? You're picking a random value and showing an icon, that I get, but what does that have to do with filtering anything?

Lummox JR
In response to Lummox JR
it filters/reads the text, than makes certain things ,like letters or number(what ever i tell it), in to an icon that i tell it. does this make any since? I under stand it fine ,but i am the one righting it.
In response to Scoobert
Scoobert wrote:
it filters/reads the text, than makes certain things ,like letters or number(what ever i tell it), in to an icon that i tell it. does this make any since? I under stand it fine ,but i am the one righting it.

Er... so where is this text coming from? If you're picking a random number, there's no text involved.

But to read that text, you're going to need something along these lines:
proc/TextToCardNumber(t)
var/list/cardtext=list("2"=2,"3"=3, ... ,"10"=10,"J"=11,"Q"=12,"K"=13,"A"=14,"Joker"=0)
for(var/card in cardtext)
if(findtext(t,card)==1 && (length(t)==length(card) || findtext(t," ")==length(card)+1))
return cardtext[card]
return -1 // not a valid card

To read suits you could do something similar.

Lummox JR
In response to Lummox JR
no no no it does tell the usr what the card is, it makes card = rand(2, 4) so that its a random number, then when its a number it changes the number into text if 11 12 13 or 14. Than it tells the world << "[usr] drawed a [card]" and i have the script from s_smiles lib that im trying to change and what it does it change smilys like :) in to a drawing i make or i use the ones he has on there. Well i have changed that to check for like K, J, Q, or A and make it the card icon i have made so it shows up on the text window as a card like world<<[usr] drew a [card]" and now card is an icon. But i can not get that to work. This is spuzzems libary that im using if he can help he might under stand a little better.