Post by wickedfrost on Dec 30, 2008 0:05:34 GMT -5
Copy and Paste, no credit needed, (even though I just put this together)
Pretty long, I know
Pretty long, I know
//The script will work fine with the // at the beginning.
//Use the /set command once you've put these scripts in.
Event +PlayerSignOn
// Of course, put your Server's name where it says [server name]
// Now for the basics.
// There's /sendpm and /sendall.
// /sendpm sends a message to the player you specified, such as #source to send it to the person that used a command, etc
// /sendall sends a message to everybody online.
// This is a little more complex, having the changeable bot name, but it won't be too difficult.
// Quotation marks, " ", tell the script that in between these is the message.
// & are used to tell the script that the following part is outside a message.
// The $name(#source) tells the server to get the person who just logged in
/sendpm #source, $Bot & " Welcome to [server name], " & $name(#source) & "."
/sendpm #source, $Bot & " Type /commands to see the commands, and /rules to see the rules."
If $name(#source) = ""
// This above means that if a player's name is blank, the server will immediately tell everyone this:
/sendall $Bot & " A ghost tried to enter the server!"
/sendall $Bot & " This script won't let it!"
/sendpm #source, $Bot & " Your IP and SID will be posted in the chat, and you will probably be firewall banned."
/ban #source
/sendall $Bot & " Just in case you need it, here's the ghost's SID and IP."
/sendall $Bot & " SID: " & $getplayerinfo(#source,PSID)
/sendall $Bot & " IP: " & $getplayerinf(#source, IPAD)
EndEvent
Event +NewMessage
If #IsIn($message, "SCRIPT ERROR IN LINE ") = 1 AND $PNumber("[admin name]") > 0
// Just to tell you a script error, so you don't have to look at the Master Server window after every time you make new scripts.
/sendpm #PNumber("[admin name]") "*** Script error in line: " & $message
EndIf
EndEvent
Event +ChatMessage
If $message = "/set" AND $getplayerinfo(#source,PSID) = "[your SID here]"
// Your SID is acessible by right-clicking youself (if you already have auth) and clicking Control Window. SID is the Static IDentification of a player. DO NOT GIVE THIS TO OTHER PEOPLE.
/set $Bot "±Bot:"
/set #mutee
/set $targes
/set #targes
/set #demutee
/sendall "SCRIPT: Sucessfully set the variables"
/stopevent
EndIf
If $message = "/commands"
/sendpm #source, " "
// Again, type your server's name where it says [server name]
/sendpm #source, $Bot & " Here are [server name]'s commands"
/sendpm #source, " "
/sendpm #source, $Bot & " Type /time to see the time"
/sendpm #source, $Bot & " Type /rules to see the rules"
/stopevent
If $getplayerinfo(#source, AUTH) = 1
// These will show only to a person with * auth.
/sendpm #source, $Bot & " Type /sendall to send a message into the chat"
/sendpm #source, $Bot & " Type /kick to kick a person"
/sendpm #source, $Bot & " Type /mute to mute a person"
/sendpm #source, $Bot & " Type /demute to demute a person"
/stopevent
If $getplayerinfo(#source,AUTH) = 2
// These, plus the ones above will show to a person with ** auth.
/sendpm #source, $Bot & " Type /botname to change the bot's name"
/sendpm #source, $Bot & " Type /ban to ban a person"
/stopevent
EndIf
EndIf
EndIf
If $message = "/time"
// This is just for the lulz, a little addition. I'm not sure if #date is recognizeable but the script, though. =\
/sendpm #source, $Bot & " The current time is " & #time & "."
/stopevent
EndIf
If $message = "/rules"
// Add more, if needed. You can reword it, just rmember the quotation mark's importance!
// Again, change [server name] with your server's name.
/sendpm #source, $Bot & " Here are [server name]'s rules and expectations."
/sendpm #source, $Bot & " 1. No spamming"
/sendpm #source, $Bot & " NOTE: SPAM = Stupid, pointless, annoying messages."
/sendpm #source, $Bot & " 2. No flaming"
/sendpm #source, $Bot & " 3. No flooding"
// Flooding and spamming aren't the same. Spamming is repeating a message, etc so it becomes annoying. Flooding is where the person get auto-kicked for saying it too many times. This can be bypassed by several programs, however...
/sendpm #source, $Bot & " 4. No botting"
/sendpm #source, $Bot & " 5. No ghosting, we have an anti-ghost script, so don't even try!!"
/sendpm #source, $Bot & " 6. And remember, please have fun!"
/stopevent
If $getplayerinfo(#source, auth) > 0
/sendpm #source, $Bot & " Because you have auth, it is expected that you do not abuse it. If you do, you will be deauthed and kicked."
/stopevent
EndIf
EndIf
If $left($message, 9) = "/sendall " AND $getplayerinfo(#source, AUTH) > 0
// Ahh, the basic and loveable Sendall script. You might already know, but this is very close to being a script where you can temporarily change your name... try looking at Official Server's /chatas command, or ask someone with auth about it...
/sendall $right($message, #len($message) - 9)
/stopevent
EndIf
// These below were extremely hard to write, and unless you're a master, it'll be difficult to learn this.
If $Left($Message, 6) = "/Mute " AND $getplayerinfo(#source,AUTH) > 0
/Set #Mutee, #PNumber($Right($Message, #Len($Message) - 6))
If #Mutee = 0
/SendPM #Source, $Bot & " That player isn't on..."
/StopEvent
/Exit
EndIf
If $getplayerinfo(#source, AUTH) = 0
/SendPM #Source, $Bot & " You don't have enough auth"
/StopEvent
/Exit
EndIf
If #GetValue($GetPlayerInfo(#Mutee, PSID) & "\mute") = 1
/SendPM #Source, $Bot & " That player is already muted."
/StopEvent
/Exit
EndIf
/SendAll $Bot & " " & $Name(#Mutee) & " has been muted by " & $Name(#Source) & ". Any messages they send will not appear in the main chat."
/SaveValue $GetPlayerInfo(#Mutee, PSID) & "\mute", 1
/StopEvent
/Exit
EndIf
If $Left($Message, 8) = "/DeMute " AND #getplayerinfo(#source,
AUTH) > 0
/Set #Demutee, #PNumber($Right($Message, #Len($Message) - 8 ))
If #Demutee = 0
/SendPM #Source, $Bot & " That player's not on..."
/StopEvent
/Exit
EndIf
If #Demutee = #Source
/SendPM #Source, $Bot & " If you're muted, it's probably for a good reason."
/StopEvent
/Exit
EndIf
If #GetValue($GetPlayerInfo(#Demutee, PSID) & "\mute") = 0
/SendPM #Source, $Bot & " '" & $Name(#Demutee) & "' is not muted."
EndIf
If #GetValue($GetPlayerInfo(#Demutee, PSID) & "\mute") = 1
/SendAll $Bot & " " & $Name(#Demutee) & " has been demuted by " & $Name(#Source) & "."
/SaveValue $GetPlayerInfo(#Demutee, PSID) & "\mute", 0
EndIf
/StopEvent
/Exit
EndIf
If #GetValue($GetPlayerInfo(#Source, PSID) & "\mute") = 1
/StopEvent
/Exit
EndIf
If $left($message, 6) = "/kick " AND $getplayerinfo(#source, AUTH) > 0
/Set $Targes, $Right($Message,#Len($Message)-5)
/Set #Targes, #PNumber($Targes)
If $getplayerinfo(#source, AUTH) = 0
/SendPM #Source, $Bot & " You don't have the permission to kick this person. "
Else
If #Targes <> 0
/SendAll $Name(#Source) & " kicked " & $Name(#Targes) & ":"
/Kick #Targes
EndIf
EndIf
EndIf
If $Left($Message, 5) = "/Ban " AND $getplayerinfo(#source, AUTH) = 2
/Set $Targes, $Right($Message,#Len($Message)-5)
/Set #Targes, #PNumber($Targes)
If $getplayerinfo(#source,AUTH) < 2
/SendPM #Source, $Bot & " You don't have the permission to ban this person. "
Else
If #Targes <> 0
/SendAll $Name(#Source) & " banned " & $Name(#Targes) & ":"
/Ban #Targes
EndIf
EndIf
EndIf
If $Left($Message, 9) = "/BotName " AND $getplayerinfo(#source, AUTH) = 2
/Set $Bot, $Right($Message, #Len($Message) - 9) & ":"
/SendAll $Bot & " " & $Name(#Source) & " changed the bots name to " & $Bot
/StopEvent
/Exit
EndIf
EndEvent
// WickedFrost's "Beginner Scripts"
// No credit is needed.
// Don't remove the parts with the // before it, the script will work just fine. Also, look for the // messages inside the scripts, to learn more about scripting.