ID:175385
 
Checking the users messages. Is there a way to make the game automaticly reboot is someones messages has the words: lag, laggy, reboot in it? (also if this is possible would it auotmaticly reboot if the words were in capitals or like LaG or lAg?)
Im not 100% sure how to do this, but im not sure if you would want it either. what if someone you don't like, or sum1 who has a secret grudge on you comes in ur games, and spams lag.............constant reboots and everyone leaves...........torture. I don't think this is the best idea. of course, its ur game, so do what you want. Anyway, im gunna take a whack at the code:
mob
verb
say(t as text)
var/words = list("lag","LAG","LaG","Reboot"etc)
if(t == words)
world << "[usr]:[t]"
world.reboot()
else
world << "[usr]:[t]"
In response to Airjoe
your right ill prob just have automatic reboots every couple hours or so...and by the wat your coding would check for only those worls what if the message was AHHH LAG! it wouldnt reboot because the if is only checking for only those words
In response to Koolguy900095
ok, i tried. i wasn't really sure, i just took a wakc at it.
You could do something like this:

mob
verb
say(t as text)
var/words = list("lag","reboot") //list of words
for(var/x in words) //for every word in the list
if(findtext(t, x)) //look if word x is anywhere in t
world << "[usr]:[t]"
world.Reboot()
else
world << "[usr]:[t]"
In response to Jon88
Note, it would be world.Reboot(), not world.reboot() casing matters.
In response to Jon88
Jon88 wrote:
You could do something like this:

mob
> verb
> say(t as text)
> var/words = list("lag","reboot") //list of words
> for(var/x in words) //for every word in the list
> if(findtext(t, x) //look if word x is anywhere in t
> world << "[usr]:[t]"
> world.reboot()
> else
> world << "[usr]:[t]"


Note yourfindtext code. there should be 2 closing perenthesis:if(findtext(t, x))
In response to Airjoe
Airjoe wrote:
say(t as text)
var/words = list("lag","LAG","LaG","Reboot"etc)
if(t == words)

Gads no. What were you thinking?

Since t is a text string, it is not a list. Nor will if(t in words) work much better, since that will only match a whole string. What you need to do is use findtext(), and loop through the list to check if things match.
for(var/word in words)
if(findtext(t,word))
...
Not that it's of much help to Koolguy, since rebooting a game automatically based on what players say is idiotic.

Lummox JR
Koolguy900095 wrote:
Checking the users messages. Is there a way to make the game automaticly reboot is someones messages has the words: lag, laggy, reboot in it? (also if this is possible would it auotmaticly reboot if the words were in capitals or like LaG or lAg?)

It's possible to do this, just like it's possible to use sewage as a condiment.

This is a bad idea of unholy proportions. For one thing, players often perceive lag when they themselves are the only ones experiencing it, or if their computers are too slow, or if they merely think the game is slower than it ought to be when it isn't. For another, a malicious player who knew about this could force you to reboot over and over and over, making gameplay all but impossible.

Finally--and this is very important--rebooting does not cure lag. Duh! I've hosted plenty of games where a few morons popped in, saw lag real or imagined, and started clamoring for a reboot. I ignore them because their suggestions are worthless; it would accomplish nothing, and they don't know what they're talking about.

So please, don't put in this feature. It's beneath you.

Lummox JR