Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 07-18-2001, 05:05 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Question How to test for a number...

Ok I'm stumped.. how would it be possible to check what the player says via #c, and check to see if the text is a number?

What I mean is like, if the player says "adosfj", then check if its a number, if it isn't perform an else, but if they say "23502", then it would be correct.

Basically to check if its a number and not letters or other characters.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #2  
Old 07-18-2001, 09:14 PM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
NPC Code:

if (playerchats) {
if (!strcontains(#c,0)||!strcontains(#c,1)||!strconta ins(#c,0)||!strcontains(#c,0)||!strcontains(#c,0)| |!strcontains(#c,0)||!strcontains(#c,0)||!strconta ins(#c,0)||!strcontains(#c,0)||!strcontains(#c,0)) {
setplayerprop #c,;
}
}


Hehe I'm not that good at stuff like that...but I think that should work...
__________________

-=Shard IceFire=-
Reply With Quote
  #3  
Old 07-18-2001, 09:25 PM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Hmm...
NPC Code:
if (playerchats) {
this.test=0;
for (i=0;i<strlen(#c);i++) {
this.test=strcontains(#e(i,1,#c),-1234567890);
}
if (this.test==1) setplayerprop #c,Whoa, you only said numbers!@;
else setplayerprop #c,Hmm, that wasn't all numbers;
}

__________________

Reply With Quote
  #4  
Old 07-18-2001, 09:34 PM
Shard_IceFire Shard_IceFire is offline
Registered User
Shard_IceFire's Avatar
Join Date: Jun 2001
Location: Eastern Harkoonia
Posts: 861
Shard_IceFire is on a distinguished road
__________________

-=Shard IceFire=-
Reply With Quote
  #5  
Old 07-18-2001, 09:54 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Hmm that seems close LM.. but its not working right for some reason.. it always says it doesn't have all numbers =/
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #6  
Old 07-19-2001, 04:46 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Someone make a logical guess please.. *boost*
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #7  
Old 07-19-2001, 10:23 PM
BeZeRkEr BeZeRkEr is offline
what
BeZeRkEr's Avatar
Join Date: Jun 2001
Posts: 1,863
BeZeRkEr is on a distinguished road
Send a message via ICQ to BeZeRkEr Send a message via AIM to BeZeRkEr
i have no clue y0
Reply With Quote
  #8  
Old 07-19-2001, 10:44 PM
CyanideSR71 CyanideSR71 is offline
Registered User
CyanideSR71's Avatar
Join Date: Jun 2001
Location: Canada
Posts: 460
CyanideSR71 is on a distinguished road
doesn't if (playersaysnumber) work?
__________________
Cyanide SR71
Former Shadow Dragon
Co-Owner of what was Murasamune
Reply With Quote
  #9  
Old 07-19-2001, 10:45 PM
BeZeRkEr BeZeRkEr is offline
what
BeZeRkEr's Avatar
Join Date: Jun 2001
Posts: 1,863
BeZeRkEr is on a distinguished road
Send a message via ICQ to BeZeRkEr Send a message via AIM to BeZeRkEr
hmm
i never heard of that command..
Reply With Quote
  #10  
Old 07-19-2001, 10:54 PM
G_yoshi G_yoshi is offline
Forbidden
G_yoshi's Avatar
Join Date: Mar 2001
Posts: 7,206
G_yoshi will become famous soon enough
Send a message via AIM to G_yoshi
you could possibly use tokenize
__________________
Reply With Quote
  #11  
Old 07-19-2001, 11:01 PM
KJS KJS is offline
The one, The only -
KJS's Avatar
Join Date: Apr 2001
Location: USA, Minnesota
Posts: 1,012
KJS is on a distinguished road
Send a message via AIM to KJS
Quote:
Originally posted by CyanideSR71
doesn't if (playersaysnumber) work?
yea it does or should...

that was what I was like when people were comming up with these long scripts lol....


that is how I made a bank script a long time ago..
__________________
Thanks,
-KJL
Reply With Quote
  #12  
Old 07-20-2001, 02:10 AM
grim_squeaker_x grim_squeaker_x is offline
Retired Oldbie
grim_squeaker_x's Avatar
Join Date: Mar 2001
Posts: 3,084
grim_squeaker_x will become famous soon enough
Quote:
Originally posted by CyanideSR71
doesn't if (playersaysnumber) work?
Well you keep ending up creating variables with what you just said if don't say a number while using that.
__________________

Reply With Quote
  #13  
Old 07-20-2001, 08:36 AM
BeZeRkEr BeZeRkEr is offline
what
BeZeRkEr's Avatar
Join Date: Jun 2001
Posts: 1,863
BeZeRkEr is on a distinguished road
Send a message via ICQ to BeZeRkEr Send a message via AIM to BeZeRkEr
all these new commands are confusing meh!@
i need to learn how to use keydown
LM help, y0
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 04:12 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.