Pinkie Bot chat command script

function logChat(avatar,name,text,color,userid,title,bgColor){
bgColor=(bgColor==undefined)?"":bgColor;
title=(title==undefined)?"User":title;
$("#chat-history ul").prepend("<li style='background:"+ bgColor+";'><div class='pull-left'><img style='border-color:"+ color+";' src='"+ avatar+"' alt='Avatar' /></div><span><a class='chat-ulink' title='"+ title+"' target='_blank' href='/profile?u="+ userid+"' style='color:"+ color+";'>"+ name+"</a></span><br/>"+ text+"</li>")
$(".chat-ulink").tooltip();
if($("#chat-history").children().children().length>50){
$("#chat-history ul li:last").remove();
}
runCmds(text,name,userid);
}

function runCmds(text,name,userid) {
if(userid!==73047) {
if(text.toUpperCase().indexOf(("Thing to detect here").toUpperCase())!==-1) {
socket.emit("chat",{"msg":"Message Here!"});
}
if(text.toUpperCase().indexOf(("Other thing to detect here").toUpperCase())!==-1) {
socket.emit("chat",{"msg":"Other message Here!"});
}
}
}

Gift Box Script

#Gift Box
#By Wheemangga
options:
L: &7[&aGift Box&7]
on break of sponge:
chance of 50%:
drop 12 diamonds
send "{@L} &aCongrats!&7 you just Win &b5 Diamonds&7 from Gift Box!"
add 1 to {coin.%player%}
stop
chance of 50%:
give a gold ingot named "&eCoin" to the player
send "{@L} &aCongrats!&7 you just Win &b1 Coin&7 from Gift Box!"
stop
chance of 50%:
strike lightning at the player
send "{@L} &cSorry&7, you are unlucky today"
stop

Jake Sparrow 1.0.1 Quest Script

Options:
L: &8[&6Q&8] &7Jack Sparrow &3&l>&f
On rightclick on entity:
Loop entities in radius 5 of player:
loop-entity's name contains "Jack_Sparrow":
{Quis.%player%} is not set:
set {Quis.%player%} to false
send "a"
{Quis.%player%} is false:
send "{@L} Hai! Aku butuh bantuanmu!"
send "{@L} Aku membutuhkan &a3 Brick&f untuk membuat kapalku, Maukah kau membantuku?"
send "{@L} Quest : &aJack's Brick"
send "{@L} &aYes &6/ &cNo"
{Quis.notdone.%player%} is false:
send "{@L} Kau sudah mendapatkan 3 Brick yang kumau?"
{Quis.notdone.%player%} is true:
send "{@L} Terimakasih telah Membantuku!"
On rightclick on Entity:
Loop entities in radius 5 of player:
loop-entity's name contains "Jack_Sparrow":
player is holding 3 brick:
{Quis.%player%} is true:
{Quis.notdone.%player%} is false:
remove 3 brick from player's inventory
send "{@L} &aTerimakasih! Aku sekarang bisa membuat kapalku!"
add 1200 to player's money
set {Quis.notdone.%player%} to true
On chat:
message is "Yes":
{Quis.%player%} is false:
send "{@L} Terimakasih!"
send "&7[&6Quest&7] &aQuest Started"
send "&aJack's Brick"
set {Quis.%player%} to true
set {Quis.notdone.%player%} to false
cancel event
stop
message is "NO":
{Quis.%player%} is false:
send "&7[&6Quest&7] &cQuest Canceled."
cancel event
stop
Command /aweawe:
trigger:
set {Quis.%player%} to false
send "Pong!"

Chat Manager Script

#Chat Managure :u
#By Wheemangga
Options:
L: &7[&aChat&7]
P: &7[&cAlert&7]
Command /chat [<text="help">] [<text>]:
permission: chat.admin
trigger:
arg 1 is "help":
send "{@L} &bChat Manager"
send " "
send "{@L} &a/Chat clear &7- Clear the Chat"
send "{@L} &a/Chat broadcast <message> &7- Broadcast an Alert"
send " "
send "{@L} &aChat Manager by Wheemangga"
arg 1 is "clear" or "c":
loop 200 times:
broadcast " "
broadcast " "
broadcast "{@L} Chat telah dibersihkan oleh &a%player%"
broadcast " "
stop
arg 1 is "broadcast" or "bc":
arg 2 is set:
broadcast " "
broadcast "{@P} &a%coloured arg 2%"
broadcast " "
stop
arg 2 is not set:
send "{@L} Masukkan kata!"
Command /cc:
Permission: cc.cc
trigger:
execute player command "/chat c"

EE2 Bot Owner Only And Admin Only commands

// First we must make an Listbox, for admin commands.

//Add an ListBox and name it Admins
//Now add an button, text it Add and name it add
//And then, add another button, text it Remove and name it remove.

//Now, add an text box and name it addText, after Add button, and then, another text box and name it removeText, after Remove button.
// Okay, that's good for now.


// now, the commands.

// add this to your variables:


string worldowner, str; // World Owner Commands



// now go to case "say":
// if you dont have it, add it.

case "say":

if (str.StartsWith("!admin "))
{
 // !admin [blank space] for username.
 string[] username = str.Split(' '); // now we got the username.
 if (worldowner.Contains(names[m.GetInt(0)])) // worldowner is the string we added in variables, that EE2 considers World Owner.
 {
   if (names.ContainsValue(username[1])
   {
      // now user is in world, so let's admin him.
      if (!Admins.Items.Contains(username[1]))
      {
        con.Send("say", "[Bot] " + names[m.GetInt(0)].ToUpper() + ": " + username[1] + " is now a admin.");
        Admins.Items.Add(username[1]);
      }
      else {
         con.Send("say", "[Bot] " + names[m.GetInt(0)].ToUpper() + ": " + username[1] + " is already an admin.");
      }
   else {
     con.Send("say", "[Bot] " + names[m.GetInt(0)].ToUpper() + ": " + username[1] + " is not in this world or isn't an user.");
   }
 else {
   con.Send("say", "[Bot] " + names[m.GetInt(0)].ToUpper() + ": You are not the world owner!");
 }

if (str.StartsWith("!unadmin "))
{
 // !unadmin [blank space] for username.
 string[] username = str.Split(' '); // now we got the username.
 if (worldowner.Contains(names[m.GetInt(0)])) // worldowner is the string we added in variables, that EE2 considers World Owner.
 {
   if (names.ContainsValue(username[1])
   {
      // now user is in world, so let's admin him.
      if (Admins.Items.Contains(username[1]))
      {
        con.Send("say", "[Bot] " + names[m.GetInt(0)].ToUpper() + ": " + username[1] + " is no longer a admin.");
        Admins.Items.Remove(username[1]);
      }
      else {
         con.Send("say", "[Bot] " + names[m.GetInt(0)].ToUpper() + ": " + username[1] + " is not an admin admin.");
      }
   else {
     con.Send("say", "[Bot] " + names[m.GetInt(0)].ToUpper() + ": " + username[1] + " is not in this world or isn't an user.");
   }
 else {
   con.Send("say", "[Bot] " + names[m.GetInt(0)].ToUpper() + ": You are not the world owner!");
 }
return;

// Owner commands (basic) are done.

if (str == "!a owner command")
{
 if (worldowner.Contains(names[m.GetInt(0)]))
 {
    // Code is placed here.
 }
 else
 {
    // Code is placed here and runs when user isn't owner.
 }
}


if (str == "!a admin command")
{
 if (Admins.Items.Contains(names[m.GetInt(0)]))
 {
   // Code is placed here.
 }
 else
 {
   // Code is placed here and runs when user isn't admin.
 }
}


// And that's all! ;)

GMod E2 - PlayX Controller

@name PlayX Controller
@inputs PlayX:wirelink
@outputs
@persist URI:string Length RequestList:array VideoInProgress MinimumNextDelay
@trigger

#RunFlags
runOnChat(1)

#Startup
if(first()|dupefinished())
{
    #Default the vars
    Video = ""
    Length = 0
    RequestList = array()
    VideoInProgress = 0
   
    #Settings
    MinimumNextDelay = 5000
}

#When player is detected, set the defaults
if(~PlayX & PlayX)
{
    PlayX["DisableJW",number] = 1
    print("[PLAYX] - Player Detected.")
}

#Chat Control
if(chatClk())
{
    #Chat Parsing
    LastSaid = lastSaid()
    Command = LastSaid:explode(": "):string(1):lower()
    Arg = LastSaid:explode(": "):string(2)
   
    #Play Video
    if(Command == "play")
    {
        if(VideoInProgress)
        {
            lastSpoke():plyPrint("[PLAYX] - Video already playing, please wait until it is over to start a video.")
        }
        else
        {
            URI = Arg
            VideoInProgress = 1
           
            PlayX["URI",string] = URI
            timer("Open Video",100)
        }
    }
   
    #Make a request
    if(Command == "request")
    {
        #Check if it's at least a URL
        if(Arg:lower():find("http://"))
        {
            RequestList:insertString(1,Arg)
           
            #Notify
            findByClass("player")
            Ply = findToArray()
            for(Index = 1, Ply:count())
            {
                Ply[Index,entity]:plyPrint("[PLAYX] - " + lastSpoke():name() + " requested " + Arg)
            }
           
            #Start this guy if not playing anything
            if(!VideoInProgress)
            {
                timer("Next Video",1000)
            }
        }
        else
        {
            lastSpoke():plyPrint("[PLAYX] - Invalid link!")
        }
    }
   
    #Force Stop
    if(Command == "stop video" & lastSpoke() == owner())
    {
        stoptimer("Video End")
        stoptimer("Next Video")
        VideoInProgress = 0
        PlayX["Close",number] = 1
        timer("Unclose",50)
    }
   
    #Play Next in Queue
    if(Command == "play next" & (lastSpoke():isAdmin()|lastSpoke() == owner()))
    {
        stoptimer("Video End")
        stoptimer("Next Video")
        VideoInProgress = 1
        timer("Next Video",1000)
    }
   
    #Remove the entire playlist
    if(Command == "purge queue" & lastSpoke() == owner())
    {
        RequestList = array()
    }
   
    #Request playlist
    if(Command == "view playlist")
    {
        AntiCount = RequestList:count()
        lastSpoke():plyPrint("[PLAYX] - Displaying current request list...")
        for(Index = 1, RequestList:count())
        {
            lastSpoke():plyPrint(AntiCount + ". " + RequestList[Index,string])
            AntiCount--
        }
    }
}

#Reset "Close" state
if(clk("Unclose"))
{
    PlayX["Close",number] = 0
}

#Open Inputted URL
if(clk("Open Video"))
{
    PlayX["Open",number] = 1
    timer("Get Video Info",1000)
}

#Check for video data
if(clk("Get Video Info"))
{
    PlayX["Open",number] = 0
    #Check for Error
    if(PlayX["InputError",string])
    {
        Error = PlayX["InputError",string]:lower()
       
        if(Error == "no provider was auto-detected")
        {
            print("PLAYX ERROR: Invalid URL: " + URI)
            timer("Next Video",1000)
        }
       
        if(Error == "cvar playx_wire_input is not 1")
        {
            print("PLAYX ERROR: Wire Input not allowed on Server, have an admin turn this on.")
        }
        VideoInProgress = 0
    }
    else
    {
        #Check if it's a valid video
        if(PlayX["Title",string] == "")
        {
            print("PLAYX ERROR: Video Cannot Load.")
            timer("Next Video",1000)
        }
        else
        {
            #Tell everyone a video has started
            findByClass("player")
            Ply = findToArray()
            for(Index = 1, Ply:count())
            {
                Ply[Index,entity]:plyPrint("[PLAYX] - Now Playing: " + PlayX["Title",string])
            }
           
            timer("Video End",PlayX["Length",number]*1000)
        }
    }
}

#A video ended, do stuff
if(clk("Video End"))
{
    timer("Next Video",MinimumNextDelay)
}

#Play the next video in the list
if(clk("Next Video"))
{
    VideoInProgress = 1
   
    if(RequestList:count())
    {
        Request = RequestList:popString()
        PlayX["URI",string] = Request
        timer("Open Video",100)
    }
    else
    {
        VideoInProgress = 0
    }
}

TTT Tripwire Mine

    if SERVER then
       AddCSLuaFile( "shared.lua" )
       resource.AddFile("materials/SSR/icon_tripwire.png")
    end
   
    SWEP.HoldType                           = "slam"
   
    if CLIENT then
   
       SWEP.PrintName    = "Tripwire Mine"
       SWEP.Slot         = 6
   
       SWEP.ViewModelFlip = true
       SWEP.ViewModelFOV                    = 64
     
       SWEP.EquipMenuData = {
          type = "item_weapon",
          desc = [[A mine, with a red laster, placeable on walls.
 When the red laser is crossed by innocents or
 detectives, the mine explodes. Can be shot and
 destroyed by innocents and detectives.]]
       };
   
       SWEP.Icon = "SSR/icon_tripwire.png"
    end
SWEP.Base = "weapon_tttbase"

    SWEP.ViewModel                          = "models/weapons/v_slam.mdl"   -- Weapon view model
    SWEP.WorldModel                         = "models/weapons/w_slam.mdl"   -- Weapon world model
    SWEP.FiresUnderwater = false
   
    SWEP.Primary.Sound                      = Sound("")             -- Script that calls the primary fire sound
    SWEP.Primary.Delay                      = .5                    -- This is in Rounds Per Minute
    SWEP.Primary.ClipSize                   = 3             -- Size of a clip
    SWEP.Primary.DefaultClip                = 3             -- Bullets you start with
    SWEP.Primary.Automatic                  = false         -- Automatic = true; Semi Auto = false
    SWEP.Primary.Ammo                       = "slam"
SWEP.LimitedStock = true

SWEP.NoSights = true
   
    SWEP.AllowDrop = false
    SWEP.Kind = WEAPON_EQUIP
    SWEP.CanBuy = {ROLE_TRAITOR}
   
    function SWEP:Deploy()
            self:SendWeaponAnim( ACT_SLAM_TRIPMINE_DRAW )
            return true
    end
   
    function SWEP:SecondaryAttack()
            return false
    end  
   
    function SWEP:OnRemove()
       if CLIENT and IsValid(self.Owner) and self.Owner == LocalPlayer() and self.Owner:Alive() then
          RunConsoleCommand("lastinv")
       end
    end
   
function SWEP:PrimaryAttack()
self:TripMineStick()
self.Weapon:EmitSound( Sound( "Weapon_SLAM.SatchelThrow" ) )
self.Weapon:SetNextPrimaryFire(CurTime()+(self.Primary.Delay))
end
   
function SWEP:TripMineStick()
 if SERVER then
      local ply = self.Owner
      if not IsValid(ply) then return end


      local ignore = {ply, self.Weapon}
      local spos = ply:GetShootPos()
      local epos = spos + ply:GetAimVector() * 80
      local tr = util.TraceLine({start=spos, endpos=epos, filter=ignore, mask=MASK_SOLID})

      if tr.HitWorld then
         local mine = ents.Create("npc_tripmine")
         if IsValid(mine) then

            local tr_ent = util.TraceEntity({start=spos, endpos=epos, filter=ignore, mask=MASK_SOLID}, mine)

            if tr_ent.HitWorld then

               local ang = tr_ent.HitNormal:Angle()
               ang.p = ang.p + 90

               mine:SetPos(tr_ent.HitPos + (tr_ent.HitNormal * 3))
               mine:SetAngles(ang)
               mine:SetOwner(ply)
               mine:Spawn()

                                mine.fingerprints = self.fingerprints

                                self:SendWeaponAnim( ACT_SLAM_TRIPMINE_ATTACH )
                             
                                local holdup = self.Owner:GetViewModel():SequenceDuration()
                             
                                timer.Simple(holdup,
                                function()
                                if SERVER then
                                        self:SendWeaponAnim( ACT_SLAM_TRIPMINE_ATTACH2 )
                                end  
                                end)
                                     
                                timer.Simple(holdup + .1,
                                function()
                                        if SERVER then
                                                if self.Owner == nil then return end
                                                if self.Weapon:Clip1() == 0 && self.Owner:GetAmmoCount( self.Weapon:GetPrimaryAmmoType() ) == 0 then
                                                --self.Owner:StripWeapon(self.Gun)
                                                --RunConsoleCommand("lastinv")
self:Remove()
                                                else
                                                self:Deploy()
                                                end
                                        end
                                end)
                     

                               --self:Remove()
                                self.Planted = true

self:TakePrimaryAmmo( 1 )
                             
                        end
            end
         end
      end
end

function SWEP:Reload()
   return false
end

Chat Commands Basic Framework

-----------------------------------
-- Chat Commands Basic Framework --
-- By Eccid                      --
-- put in:                       --
-- garrysmod/lua/autorun --
-----------------------------------

CHATCOMMANDS = CHATCOMMANDS or {}

--------------- Cutsom Commands ---------------
CHATCOMMANDS.KillCommands = { -- The name of your commands
"!kill", -- What to be typed into chat
"/kill" -- You can add as many to chat as you'd like.
}
CHATCOMMANDS.ExpCommands = {
"!explode",
"/explode"
}

CHATCOMMANDS.RulesCommands = {
"!rules",
"/rules"
}
CHATCOMMANDS.AFKCommands = {
"!afk",
"/afk"
}
--------------- End Cutsom Commands ---------------


--------------- Block Suicide Hook ---------------
-- One of the biggest reasons I set these       --
-- up, is so people could remove themselves     --
-- from a TTT match without putting the blame on--
-- others. Below blocks users from using kill   --
-- or explode in the console, so they have to   --
-- use the chat commands. There's a work around --
-- in place so that you can allow them to use   --
-- the explode command in chat still.           --
--------------------------------------------------
hook.Add( "CanPlayerSuicide", "BlockSuicide", function(ply)
if yesyouasplode == nil or false then -- Checks if the user has used a chat command to explode themself.
ply:PrintMessage( HUD_PRINTTALK, "This command has been disabled, type !kill or !explode into chat instead." )
return false
else
yesyouasplode = false -- If the user used the chat command, it continues to block the command afterward.
return true
end
end )
--------------- End Block Suicide Hook ---------------

--------------- Chat Commands Hook ---------------
hook.Add( "PlayerSay", "TTN Chat Commands", function(ply, text)
--------------- Kill ---------------
if table.HasValue( ccprefix..CHATCOMMANDS.KillCommands, string.lower(text) ) then -- Checks if the text contain matched the premade commands above
if ply:Alive() then -- Can't kill yourself if you're dead, this keeps users from spamming chat with fake death messages.
ply:Kill() -- The Kill Command
PrintMessage( HUD_PRINTTALK, ply:Nick().." killed themself." ) -- Tell everyone they killed themself.
end
return "" -- This is so the command doesn't appear in the chat box.
end
--------------- Explode ---------------
if table.HasValue( CHATCOMMANDS.ExpCommands, string.lower(text) ) then
if ply:Alive() then
yesyouasplode = true -- Allows the user to use the explode command just long enough for the chat command
ply:SendLua([[RunConsoleCommand("explode")]])
PrintMessage( HUD_PRINTTALK, ply:Nick().." exploded themselves." )
end
return ""
end
--------------- Rules ---------------
if table.HasValue( CHATCOMMANDS.RulesCommands, string.lower(text) ) then
ply:ConCommand("ulx motd") -- You can change this to work with whatever admon mod you're using.
return ""
end
--------------- Afk Mode ---------------
-- If any other addon you use has a   --
-- command for !afk, you can delete   --
-- this command.                      --
----------------------------------------
if table.HasValue( CHATCOMMANDS.AFKCommands, string.lower(text) ) then
        if (not IsValid(ply)) or ply:IsSpec() then
            ply:ConCommand("ttt_spectator_mode 0")
PrintMessage( HUD_PRINTTALK, ply:Nick().." removed themselves from AFK mode." )
        else
            ply:ConCommand("ttt_spectator_mode 1")
PrintMessage( HUD_PRINTTALK, ply:Nick().." went AFK." )
end
return ""
end

end )
--------------- End Chat Commands Hook ---------------

EE Bot Basic Chat Command

//OK go into your public variables, and put:

    public string str;

//Now, go to case "say" (and put this stuff):

    case "say":
    this.str = m.GetString(1).ToLower();
    //Our command here | You can do .StartsWith, .Contains, .EndsWith, or simply ==, depending on which one you need
    if (str.StartsWith("!help"))
    {
        // assuming our "Connection" is con
        con.Send("say", "[Bot] Commands go here!");
    }
    return;

the basics are:

if (str.StartsWith("commandhere"))
{
    con.Send("say", "Response here");
}

Remove chat commands in TPP

Credit goes to: findow

To remove chat commands in chrome on twitch, right click the white back window and select "inspect element", and then go over to the "console" tab and enter the following.

setInterval(function(){$('#chat_line_list li').each(function(){ var a = $(this); var t=$.trim(a.text().split(':')[1]); if (t == 'up' || t == 'down' || t == 'left' || t == 'right' || t == 'a' || t == 'b' || t == 'start') { a.hide(); }})}, 500)

Essentials Chat config

chat:

  # If EssentialsChat is installed, this will define how far a player's voice travels, in blocks.  Set to 0 to make all chat global.
  # Note that users with the "essentials.chat.spy" permission will hear everything, regardless of this setting.
  # Users with essentials.chat.shout can override this by prefixing text with an exclamation mark (!)
  # Users with essentials.chat.question can override this by prefixing text with a question mark (?)
  # You can add command costs for shout/question by adding chat-shout and chat-question to the command costs section."
  radius: 100

  # Chat formatting can be done in two ways, you can either define a standard format for all chat
  # Or you can give a group specific chat format, to give some extra variation.
  # If set to the default chat format which "should" be compatible with ichat.
  # For more information of chat formatting, check out the wiki: http://wiki.ess3.net/wiki/Chat_Formatting

  #format: '<{DISPLAYNAME}> {MESSAGE}'
  #format: '&7[{GROUP}]&r {DISPLAYNAME}&7:&r {MESSAGE}'

  group-formats:
  #  Default: '{WORLDNAME} {DISPLAYNAME}&7:&r {MESSAGE}'
  #  Admins: '{WORLDNAME} &c[{GROUP}]&r {DISPLAYNAME}&7:&c {MESSAGE}'

  # If you are using group formats make sure to remove the '#' to allow the setting to be read.
 
    default: '&a{DISPLAYNAME}:&f {MESSAGE}'
    VIP: '&8[&7VIP&8] &a{DISPLAYNAME}:&f {MESSAGE}'
    Premium: '&8[&5Premium&8] &a{DISPLAYNAME}:&f {MESSAGE}'
    Exclusive: '&8[&eExclusive&8] &a{DISPLAYNAME}:&f {MESSAGE}'
    Elite: '&8[&3Elite&8] &a{DISPLAYNAME}:&f {MESSAGE}'
    Mod: '&8[&2Mod&8] &a{DISPLAYNAME}:&f {MESSAGE}'
    Moddown: '&8[&2Mod&8] &a{DISPLAYNAME}:&f {MESSAGE}'
    Head-Mod: '&1[&9H&9e&3a&3d&3-&bM&bo&bd&1] &a{DISPLAYNAME}:&f {MESSAGE}'
    Tech: '&0[&8T&7e&7c&fh&0] &a{DISPLAYNAME}:&f {MESSAGE}'
    Admin: '&8[&cA&cd&cm&ci&cn&8] &3{DISPLAYNAME}:&f {MESSAGE}'
    owner: '&4[Owner] &8{DISPLAYNAME}: &6{MESSAGE}'

RedNetChat v6 - A ComputerCraft chat program

-- [ --------------------------------------------------------------------- ] --
-- [ RedNetChat - A public chat program for ComputerCraft                  ] --
-- [ Created by gpgautier (ign gpgauier), 2012                             ] --
-- [ Licence: Creative Commons Attribution-ShareAlike 3.0 Unported License ] --
-- [ ComputerCraft version: 1.3 and up                                     ] --
-- [ Posted to:                                                            ] --
-- [ GitHub: https://github.com/gpgautier/RedNetChat                       ] --
-- [ Pastebin: http://pastebin.com/JDU4wJxX                                ] --
-- [ --------------------------------------------------------------------- ] --

local VERSION = "0.6"
local MODEM = nil
local NICKNAME = nil
local ACTIVE = false
local BUFFER = {}
local POINTER = 0
local ONLINE = {}
local ISONLINE = false
local ID = os.computerID()
local LAST_MSG_TARGET = nil
local CHANNEL = 1
local SCROLL_POINTER = POINTER
local WIDTH, HEIGHT = term.getSize()
local LINES = HEIGHT - 6
local START_LINE = 5
local OPERATOR = "RNC"

-- [ --------------------------------------------------------------------- ] --

-- Split a string
function split(str, pat)
    local t = {}  -- NOTE: use {n = 0} in Lua-5.0
    if str ~= nil then
       local fpat = "(.-)" .. pat
       local last_end = 1
       local s, e, cap = str:find(fpat, 1)
       while s do
          if s ~= 1 or cap ~= "" then
            table.insert(t,cap)
          end
          last_end = e+1
          s, e, cap = str:find(fpat, last_end)
       end
       if last_end <= #str then
          cap = str:sub(last_end)
          table.insert(t, cap)
       end
    else
        print("##ERROR failed to split ["..str.."] by:"..pat)
    end
    return t
end

-- Log a message to file
function log(message)
  local file = io.open("rednetchat.log", "a")
  file:write("\n" .. message)
  file:close()
end

-- Application entry
function main()
  term.clear()
  term.setCursorPos(1, 1)

  if not setPeripherals() then
    print("[FATAL ERROR] Not able to setup peripherals.")
    return false
  end
 
  welcome()
end

-- Set the attached peripherals. Opens rednet modem and warps monitor
function setPeripherals()
  local i, side

  for i, side in pairs(rs.getSides()) do
    if peripheral.isPresent(side) then
      if peripheral.getType(side) == "modem" then
        MODEM = side
        if not rednet.isOpen(side) then
          rednet.open(MODEM)
        end
      end
    end
  end
 
  -- Exit with a fatal error when modem not found
  if MODEM == nil then
    print("[FATAL ERROR] No modem was detected. Plase attach a modem on any side.")
    return false
  end

  return true
end

-- Start the welcome screen
function welcome()
  local x, y

  term.clear()
  writeHeader()

  print("")
  print("")
  print("Enter a nickname and press [enter].")
  print("")
  term.write("Nickname: ")
 
  x, y = term.getCursorPos()

  while NICKNAME == nil or NICKNAME == "" do
    term.setCursorPos(x, y)
    NICKNAME = read()
    execute("/online")
    appendBuffer("[" .. OPERATOR .. "]: Type /help for a list of commands")
  end
 
  start()
end

-- Writes the screen header
function writeHeader()
  local col

  term.setCursorPos(1, 1)
  term.write("RedNet Chat " .. VERSION .. "")
  term.setCursorPos(1, 2)

  for col = 1, WIDTH do
    term.write("-")
  end
end

-- Writes the list of online users
function writeOnlineList()
  local i, v, count, x, y, col

  count = 0

  x, y = term.getCursorPos()
 
  term.setCursorPos(1, HEIGHT - 1)

  for col = 1, WIDTH do
    term.write("-")
  end
 
  term.setCursorPos(1, HEIGHT)
  term.clearLine()
  term.write("Online: ")

  for i, v in pairs(ONLINE) do
    if count == 0 then
      term.write(i)
    else
      term.write(", " .. i)
    end

    count = count + 1
  end

  if count == 0 then
    term.write("Nobody online in channel " .. CHANNEL)
  end

  term.setCursorPos(x, y)
end

-- Start the chat
function start()
  term.clear()
  writeHeader()
  writeOnlineList()

  ACTIVE = true

  showBuffer()
 
  parallel.waitForAll(input, watchEvents)
end

-- Stop the application
function stop()
  ACTIVE = false
end

-- Reset the application
function reset()
  execute("/offline")

  if rednet.isOpen(MODEM) then
    rednet.close(MODEM)
  end

  sleep(1.5)
  os.reboot()
end

-- Watch all input to provide possible shortcuts (for example usernames)
function watchEvents()
  local type, param, param2, param3, i, v
 
  while ACTIVE do
    type, param, param2, param3 = os.pullEvent()

    if type == "key" then
      if param == 200 then -- up
        scroll(-1)
      elseif param == 208 then -- down
        scroll(1)
      elseif param == 201 then -- pageup
        scroll(-12)
      elseif param == 209 then -- pagedown
        scroll(12)
      --else
      --  appendBuffer(tostring(param))
      end
    elseif type == "mouse_scroll" then
      if param == -1 then
        scroll(-1)
      else
        scroll(1)
      end
    elseif type == "rednet_message" then
      receive(param2)
    end
  end
end

-- Scroll through the chat
function scroll(amount)
  SCROLL_POINTER = SCROLL_POINTER + amount
  showBuffer()
end

-- Handle input from the prompt
function input()
  local message, col

  term.setCursorPos(1, 4)
 
  for col = 1, WIDTH do
    term.write("-")
  end

  while ACTIVE do
    term.setCursorPos(1, 3)
    term.clearLine()
    term.write("[" .. CHANNEL .. "] > ")

    message = read()

    if message ~= nil and message ~= "" then
      execute(message, "local")
    end
  end
end

-- Send a message
function send(message, target)
  local request, serialized, x, encrypted

  request = {protocol = "rnc", nickname = NICKNAME, sender = ID, target = target, channel = CHANNEL, message = message}
  serialized = textutils.serialize(request)

  encrypted = ""
  for x = 1, #serialized do
    encrypted = encrypted .. string.char(serialized:byte(x) + 1)
  end

  if request.target ~= nil then    
    rednet.send(request.target, encrypted)
  else
    rednet.broadcast(encrypted)
  end
end

-- Recieve a message
function receive(message)
  local request, decrypted, x

  if message ~= nil and message ~= "" then

    decrypted = ""
    for x = 1, #message do
      decrypted = decrypted .. string.char(message:byte(x) - 1)
    end

    request = textutils.unserialize(decrypted)

    if request.protocol == "rnc" and request.channel == CHANNEL then
      if request.nickname ~= nil and request.nickname ~= "" then
        execute(request, "remote")
      end
    end
  end
end

-- Execute a command or add a chat message
function execute(message, source)
  local command, splitCommand, nickname, id, body, onlineUser
 
  if message.nickname ~= nil then
    executeRemote(message)
    return
  end

  if message:sub(0, 1) == "/" then
      command = message:sub(2)

      if command == "quit"
          or command == "reset"
          or command == "restart"
          or command == "reboot"
          or command == "stop"
        then
          appendBuffer("[" .. OPERATOR .. "]: Stopping application")
          reset()
      elseif command == "online" then
        if not ISONLINE then
          send("/online")
          putOnline()
          appendBuffer("[" .. OPERATOR .. "]: You are now online")
          ISONLINE = true
        else
          appendBuffer("[" .. OPERATOR .. "]: You are already online")
        end
      elseif command == "offline" then
        if ISONLINE then
          send("/offline")
          takeOffline()
          appendBuffer("[" .. OPERATOR .. "]: You are now offline")
          ISONLINE = false
        else
          appendBuffer("[" .. OPERATOR .. "]: You are already offline")
        end
      elseif command:sub(0, 5) == "nick " then
        takeOffline()
        NICKNAME = command:sub(6)
        putOnline()
        appendBuffer("[" .. OPERATOR .. "]: Your nickname has been changed")
      elseif command:sub(0, 5) == "slap " then
        appendBuffer(command:sub(6) .. " was slapped by " .. NICKNAME)
      elseif command:sub(0, 4) == "msg " then
        splitCommand = split(command:sub(5), "%s")

        onlineUser = false

        for nickname, id in pairs(ONLINE) do
          if nickname == splitCommand[1] then
            body = command:sub(5 + splitCommand[1]:len() + 1)
            send(body, id)
            appendBuffer(NICKNAME .. " > " .. nickname .. ": " .. body)
            onlineUser = true
            LAST_MSG_TARGET = nickname
          end
        end

        if not onlineUser then
            appendBuffer("[" .. OPERATOR .. "]: User " .. splitCommand[1] .. " is not online")
        end
      elseif command:sub(0, 2) == "r " then
        if LAST_MSG_TARGET ~= nil then
          execute("/msg " .. LAST_MSG_TARGET .. " " .. command:sub(3), "local")
        else
          appendBuffer("[" .. OPERATOR .. "]: No valid user for message")
        end
      elseif command:sub(0, 5) == "join " then
        if CHANNEL ~= tonumber(command:sub(6)) then
          execute("/offline")
          CHANNEL = tonumber(command:sub(6))
          execute("/online")
          appendBuffer("[" .. OPERATOR .. "]: Joined channel " .. CHANNEL)
        else
          appendBuffer("[" .. OPERATOR .. "]: Already in channel " .. CHANNEL)
        end
      elseif command == "help" then
        appendBuffer("[" .. OPERATOR .. "] Commands:")
        appendBuffer("/quit : Exit the chat")
        appendBuffer("/msg <nickname> <message> : Send a private message")
        appendBuffer("/r <message> : Reply to a private message")
        appendBuffer("/join <channel> : Switch channel")
      else
        appendBuffer("[" .. OPERATOR .. "]: Unknown command")
      end
     
      return
  end

  appendBuffer(NICKNAME .. ": " .. message)
  send(message)
end

--
function putOnline(nickname, id)
  if nickname == nil or id == nil then
    nickname = NICKNAME
    id = ID
  end

  ONLINE[nickname] = id

  writeOnlineList()
end

--
function takeOffline(nickname, id)
  if nickname == nil or id == nil then
    nickname = NICKNAME
    id = ID
  end

  ONLINE[nickname] = nil

  writeOnlineList()
end

--
function executeRemote(request)
  local command

  if request.message:sub(0, 1) == "/" then
    command = request.message:sub(2)

    if command == "online" then
      putOnline(request.nickname, request.sender)
      appendBuffer("[" .. OPERATOR .. "]: " .. request.nickname .. " is now online")
      send("/metoo")
    elseif command == "offline" then
      takeOffline(request.nickname, request.sender)
      appendBuffer("[" .. OPERATOR .. "]: " .. request.nickname .. " is now offline")
    elseif command == "metoo" then
      putOnline(request.nickname, request.sender)
    end
    return
  end

  if request.target ~= nil then
    appendBuffer(request.nickname .. " > " .. NICKNAME .. ": " .. request.message)
    LAST_MSG_TARGET = request.nickname
  else
    appendBuffer(request.nickname .. ": " .. request.message)
  end
end

--
function appendBuffer(message)
  local length

  length = message:len()

  if length > WIDTH then
    table.insert(BUFFER, message:sub(1, WIDTH))
    POINTER = POINTER + 1
    appendBuffer(message:sub(WIDTH + 1))
  else
    table.insert(BUFFER, message)
    POINTER = POINTER + 1
  end

  SCROLL_POINTER = POINTER

  showBuffer()
end

--
function showBuffer()
  local i, line, bufferPointer, x, y, pointer

  pointer = SCROLL_POINTER
 
  if pointer == 0 then
    return
  elseif SCROLL_POINTER > POINTER then
    SCROLL_POINTER = POINTER
    pointer = POINTER
  elseif POINTER < LINES + 1 then
    SCROLL_POINTER = POINTER
    pointer = POINTER
  elseif POINTER > LINES and SCROLL_POINTER < LINES then
    SCROLL_POINTER = LINES
    pointer = SCROLL_POINTER
  end

  x, y = term.getCursorPos()
 
  line = START_LINE

  bufferPointer = -(LINES - 1 - pointer)
 
  for i = bufferPointer, bufferPointer + (LINES - 1) do
    term.setCursorPos(1, line)
    term.clearLine()
   
    if BUFFER[i] ~= nil then
      term.write(tostring(BUFFER[i]))
    end
   
    line = line + 1
  end

  term.setCursorPos(x, y)
end

-- Fire up the application
main()

Chatzy Commands

~~~~~User actions~~~~~

/leave or /bye
Leave the chat, letting other users know.

/away
Mark me temporarily away from the chat (the Visitor List will reflect this).

/me smiles
Tell the other users what I am doing (in the third person). E.g.: /me smiles => John smiles

/message
Write a longer message for the room.

~~~~~System queries~~~~~

/time +0200
Show the current time in the indicated time zone. Default is GMT/UTC. The optional time zone parameter must be in the format +/-HHMM. Tell me more.

/flipcoin
Randomly select either heads or tails.

/rolldie
Randomly select a number between 1 and 6. A number may be added indicating a maximum outcome other than 6. E.g.: /rolldie 9 => select a number between 1 and 9.

/choose red, green, blue
Randomly select between the given parameters (e.g. red, green and blue). Minimum two parameters must be supplied, separated with commas.

~~~~~Admin actions~~~~~

/ban
Ban a user from the room. Only available in rooms where the user is required to register his/her email with Chatzy.

/allow
Removes a /ban on a user or adds the user to the list of accepted emails. Only available in rooms where the user is required to register his/her email with Chatzy.

/kick
Kicks a visitor temporarily out of the room. Since the user can simply choose another name, no ban is upheld against the user - he or she can enter again (unless the room is full).

~~~~~Menu shortcuts~~~~~

/clear or /c
Same as clicking "Clear Room" in the menu.

/visitor or /v
Same as clicking "Visitor List".

/invite or /i
Same as clicking "Invite People".

/prefs or /p
Same as clicking "My Preferences".

/room or /r
Same as clicking "Room Properties".

/na /da /sa
Selects "No Alerts", "Alert By Dialog", or "Alert By Sound", respectively.

/input /menu /pane
Shows or hide the multiline input field, the left menu, or the visitor pane, respectively.

/font <1-5>
Changes the font size used for room content. 1 is the smallest font and 5 is the largest. E.g.: /font 3 => select font size 3 (default).

Wecos Chat Commands

package main;

import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionEffect;

public class WecosChatCommands extends JavaPlugin {


@Override
public void onEnable() {
initConfig();
}

private void initConfig() {
this.reloadConfig();
this.getConfig().options().header("WecosChatCommands Config");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.LoadedSuccesfull", "[WecosChatCommands] Loaded Succesfull.");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.InstalledVersion", "[WecosChatCommands] The installed version is");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.FakeLeave", " left the game.");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.FakeJoin", " joined the game.");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.FakeOp", "[Console: Opped ");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.FakeOp2", "]");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.WasFeeded", " was Feeded.");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.YouWereFeeded", "You were Feeded.");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.YouWereHealed", "You were Healed.");
this.getConfig().addDefault("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.WasHealed", " was Healed.");

this.getConfig().options().copyDefaults(true);
this.saveConfig();
System.out.println("[WecosChatCommands] (Re)loaded Config succesfully.");
}

@Override
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {

//Umwandlung Sender --> Player
Player p = null;
if(sender instanceof Player){
p = (Player)sender;
}

//test
if(cmd.getName().equalsIgnoreCase("wcctest")){

if (p != null) {

if(p.hasPermission("wecoschatcommands.wcctest"));

String version = this.getDescription().getVersion();

p.sendMessage(ChatColor.GREEN + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.LoadedSuccesfull") + " ");
p.sendMessage(ChatColor.GREEN + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.InstalledVersion") + " " + version);

for(int i = 0; i < this.getDescription().getAuthors().size(); i++){

}

return true;
} else {
String version = this.getDescription().getVersion();
sender.sendMessage(ChatColor.GREEN + "[FakeLeave] Loaded Succesfull.");
sender.sendMessage(ChatColor.GREEN + "[FakeLeave] The installed version is " + version);
return true;
}
}
//fakeleave
if(cmd.getName().equalsIgnoreCase("fakeleave")){
if(p != null){
if(p.hasPermission("wecoschatcommands.fakeleave"));
       for (Player players : Bukkit.getOnlinePlayers()){
players.sendMessage(ChatColor.YELLOW + p.getDisplayName() + "" + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.FakeLeave") +  " ");
return true;
}
}
}
//End

//fakejoin
if(cmd.getName().equalsIgnoreCase("fakejoin")){
if(p != null){
if(p.hasPermission("wecoschatcommands.fakejoin"));
       for (Player players : Bukkit.getOnlinePlayers()){
       
players.sendMessage(ChatColor.YELLOW + p.getDisplayName() + "" + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.FakeJoin") +  " ");
return true;
}
}

}
//End
//fakeop
if(cmd.getName().equalsIgnoreCase("fakeop")){
if(p != null){
if(p.hasPermission("wecoschatcommands.fakeop"));
if(args.length != 1){
return false;
}

Player targetPlayer = this.getServer().getPlayer(args[0]);
targetPlayer.sendMessage(ChatColor.GRAY + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.FakeOp") + "" + targetPlayer.getDisplayName() + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.FakeOp2") + "");

return true;
}
}

//End

//feed
if(cmd.getName().equalsIgnoreCase("wccfeed")){
if(p != null){
if(p.hasPermission("wecoschatcommands.wccfeed"));
if(args.length != 1){
p.setFoodLevel(20);
p.sendMessage(ChatColor.GREEN + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.YouWereFeeded"));
}

Player targetPlayer = this.getServer().getPlayer(args[0]);
targetPlayer.setFoodLevel(20);
p.sendMessage(ChatColor.GREEN + targetPlayer.getDisplayName() + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.WasFeeded") + "");
targetPlayer.sendMessage(ChatColor.GREEN + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.YouWereFeeded"));

return true;
}
}

//End

//heal
if(cmd.getName().equalsIgnoreCase("wccheal")){
if(p != null){
if(p.hasPermission("wecoschatcommands.wccheal"));
if(args.length != 1){
p.setHealth(20.0);
p.setFoodLevel(20);

   for (PotionEffect effect : p.getActivePotionEffects())
      p.removePotionEffect(effect.getType());
 
p.sendMessage(ChatColor.GREEN + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.YouWereHealed"));
}

Player targetPlayer = this.getServer().getPlayer(args[0]);
targetPlayer.setFoodLevel(20);
targetPlayer.setHealth(20.0);
   for (PotionEffect effect : targetPlayer.getActivePotionEffects())
      targetPlayer.removePotionEffect(effect.getType());
 
p.sendMessage(ChatColor.GREEN + targetPlayer.getDisplayName() + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.WasHealed") + "");
targetPlayer.sendMessage(ChatColor.GREEN + this.getConfig().getString("WecosChatCommands.commands.WECOSCHATCOMMANDS.messages.message.YouWereHealed"));

return true;
}
}

//wcckickall
if(cmd.getName().equalsIgnoreCase("wcckickall")){
if(p != null){
if(p.hasPermission("wecoschatcommands.wcckickall"));
       for (Player players : Bukkit.getOnlinePlayers()){
players.kickPlayer(ChatColor.GREEN + "[WecosChatCommands:] " + ChatColor.YELLOW + p.getDisplayName() + " kicked everyone.");
return true;
}
}
}

//End
//wcckillall
if(cmd.getName().equalsIgnoreCase("wcckillall")){
if(p != null){
if(p.hasPermission("wecoschatcommands.wcckillall"));
       for (Player players : Bukkit.getOnlinePlayers()){
       players.sendMessage(ChatColor.GREEN + "[WecosChatCommands:] " + ChatColor.YELLOW + p.getDisplayName() + " killed everyone.");
players.setHealth(0.0);
return true;
}
}
}

//End


return false;
}

}

Phredd's IRC Twitch chat bot

### Phredd's IRC Twitch chat bot

import socket #imports module allowing connection to IRC
import threading #imports module allowing timing functions

#sets variables for connection to twitch chat
bot_owner = 'Phredd_'
nick = 'PhreddBot'
channel = '#oddmast'
server = 'phreddbot.jtvirc.com'
password = 'xxx'

queue = 0 #sets variable for anti-spam queue functionality

#sets variables for !add and !news commands
command = '!notset'
cmdmsg = 'This command is not set yet'
newsmsg = 'No news set'


irc = socket.socket()
irc.connect((server, 6667)) #connects to the server

#sends variables for connection to twitch chat
irc.send('PASS ' + password + '\r\n')
irc.send('USER ' + nick + ' 0 * :' + bot_owner + '\r\n')
irc.send('NICK ' + nick + '\r\n')
irc.send('JOIN ' + channel + '\r\n')

def queuetimer(): #function for resetting the queue every 30 seconds
    global queue
    print 'queue reset'
    queue = 0
    threading.Timer(30,queuetimer).start()
queuetimer()

while True:
   
    def message(msg): #function for sending messages to the IRC chat
        global queue
        queue = queue + 1
        print queue
        if queue < 20: #ensures does not send >20 msgs per 30 seconds.
            irc.send('PRIVMSG ' + channel + ' :' + msg + '\r\n')
        else:
            print 'Message deleted'
           
    def newstimer(): #function for announcing news every 3 minutes
        global newsmsg
        global ntimer
        themessage = '[NEWS]: ' + newsmsg
        message(themessage)
        print 'news on'
        ntimer = threading.Timer(180,newstimer)
        ntimer.start()
        if newsmsg == 'No news set': #stops announcing news if it has been canceled.
            ntimer.cancel()
        else:
            pass
   
    data = irc.recv(1204) #gets output from IRC server
    user = data.split(':')[1]
    user = user.split('!')[0] #determines the sender of the messages
    print data
   
    if data.find('PING') != -1:
        irc.send(data.replace('PING', 'PONG')) #responds to PINGS from the server
   
    if data.find('!test') != -1: #!test command
        message('Phredd_ is awesome! :D')      
    if data.find('!hello') != -1: #!hello command
        if user == 'phredd_':
            mymessage = 'Hi, ' + user + ', you are awesome! :D'
            message(mymessage)
        else:
            mymessage = 'Hi, ' + user + ', you are a Butt! :D'
            message(mymessage)
           
    if data.find('!cmd') != -1 and user == 'phredd_': #adds a new command
        addsplit = channel + ' :' + '!cmd'
        command = '!' + data.split(addsplit)[1].split(' ')[1] #determines new command
        cmdmsg = ' '.join(data.split(addsplit)[1].split(' ')[2:]) #determines command output
        message('Command set!')      
    if data.find(command) != -1: #responds to the new command with the output
        message(cmdmsg)
    if data.find('!delcmd') != -1 and user == 'phredd_': #!deladd command
        command = '!notset'
        cmdmsg = 'This command is not set yet'
        message('Command deleted!')
       
    if data.find('!addnews') != -1 and user == 'phredd_': #!addnews command
        newssplit = channel + ' :' + '!addnews'
        newsmsg = ' '.join(data.split(newssplit)[1].split(' ')[1:]) #determines new news message
        message('News set!')
        newstimer() #starts news timer function    
    if data.find('!news') != -1 and user == 'phredd_': #!news command
        themessage = '[NEWS]: ' + newsmsg
        message(themessage)
    if data.find('!delnews') !=-1 and user == 'phredd_': #deletes the news
        newsmsg = 'No news set'
        message('News deleted!')
        newstimer()
       
    elif data.split(' ')[1] == 'PRIVMSG' and data.split(':')[2].startswith(nick):
        message('Who said my name? SwiftRage')

TERA Online Chatroom commands

/make [ChannelName] [Password] #Password must be 4 characters long and contain only numbers
/join [ChannelName] [Password]
/leave [ChannelName/#]
/ChannelName(ChannelNumber)
/password [ch#] [CurrentPassword] [NewPassword]
/chatkick [ch#] [CharacterName]

##Additional Notes:
#Click on the chat icon and select “Add tab”
#Select a name for your chat room, and apply/confirm
#Right click on new chat tab to change options

##IMPORTANT:
#All commands are used without [] brackets, so replace [password] with 1234 for example
#/ChannelName(1234) ,brackets included

XAT COMMANDS AND GLITCHES

XAT COMMANDS AND GLITCHES By Naim Hashmi

<s2s - Censor glitch
xat.com/chat?test - Debug room
/Debug fps # - Debug speed
/o# disabling smileys
/s - Writing in Text box above

Owners only

/p - Protection mode

Find more commands in youtube and search "Xat Commands"

Pokemon Showdown commands

/msg OR /whisper OR /w [username], [message] - Send a private message.
/reply OR /r [message] - Send a private message to the last person you received a message from, or sent a message to.
/ip - Get your own IP address.
/ip [username] - Get a user's IP address. Requires: @ & ~
/rating - Get your own rating.
/rating [username] - Get user's rating.
/nick [new username] - Change your username.
/avatar [new avatar number] - Change your trainer sprite.
/rooms [username] - Show what rooms a user is in.
/whois [username] - Get details on a username: group, and rooms.
/data [pokemon/item/move/ability] - Get details on this pokemon/item/move/ability.
!data [pokemon/item/move/ability] - Show everyone these details. Requires: + % @ & ~
/analysis [pokemon], [generation] - Links to the Smogon University analysis for this Pokemon in the given generation.
!analysis [pokemon], [generation] - Shows everyone this link. Requires: + % @ & ~
/groups - Explains what the + % @ & next to people's names mean.
!groups - Show everyone that information. Requires: + % @ & ~
/opensource - Links to PS's source code repository.
!opensource - Show everyone that information. Requires: + % @ & ~
/avatars - Explains how to change avatars.
!avatars - Show everyone that information. Requires: + % @ & ~
/intro - Provides an introduction to competitive pokemon.
!intro - Show everyone that information. Requires: + % @ & ~
/cap - Provides an introduction to the Create-A-Pokemon project.
!cap - Show everyone that information. Requires: + % @ & ~
/om - Provides links to information on the Other Metagames.
!om - Show everyone that information. Requires: + % @ & ~
/learn [pokemon], [move, move, ...] - Displays how a Pokemon can learn the given moves, if it can at all.
!learn [pokemon], [move, move, ...] - Show everyone that information. Requires: + % @ & ~
/calc - Provides a link to a damage calculator
!calc - Shows everyone a link to a damage calculator. Requires: + % @ & ~
/away - Blocks challenges so no one can challenge you.
/back - Unlocks challenges so you can be challenged again.
/faq [theme] - Provides a link to the FAQ. Add deviation, doubles, randomcap, restart, or staff for a link to these questions. Add all for all of them.
!faq [theme] - Shows everyone a link to the FAQ. Add deviation, doubles, randomcap, restart, or staff for a link to these questions. Add all for all of them. Requires: + % @ & ~
Set up highlights:
/highlight add, word - add a new word to the highlight list.
/highlight list - list all words that currently highlight you.
/highlight delete, word - delete a word from the highlight list.
/highlight delete - clear the highlight list
/help OR /h OR /? - Gives you help.

Computercraft mining turtle script with variable maxfuel

--Script by victorqyu aka. sol
--11/8/13
--For Computercraft for Minecraft
--For mining turtle.
--Requires pre-fueling. (The more the better but 64 coal is adequate)
--
--running arguments are x,y,z where;
--x = Number of cycles to move forward. (A cycle consists of 3 blocks on the axis of facing where the turtle occupies the central block) eg 10 cycles = 30 blocks
--y = the number of lines to mine to the left of the turtle.
--z = Max depth to dig down
--n = maxFuel value - Value over which coal and other fuels will not be consumed prior to dumping inventory.
--Enderchest to store items in must be placed in the turtle's last inventory slot
--

local tArgs = { ... }
if #tArgs ~= 4 then --If number of args does not equal this, print useage scirpt
print( "Usage: mineAll <# cycles forward> <# lines to the left> <Depth to dig> <Max fuel buffer(7000 recomended)>" )
return --Ends the program
end

-- VAR DEC's
local fwdCycleTarget = tonumber(tArgs[1]) --retrieve blocks to dig forward of turtle
local lftCycleTarget = tonumber(tArgs[2]) --retrieve blocks to dig left of turtle
local digDepth = tonumber(tArgs[3]) --retrieve depth to dig down
local maxFuel = tonumber(tArgs[4]) --Retrieve fuel buffer
local enoughFuel = false
local keepDigging = true
local oddRowNum = false
local miningComplete = false
local yCurPos = 0
local fwdCycleCurrent = 0
local lftCyclePos = 0
-- VAR DEC's

function checkFuel() --wait for turtle to have enough fuel to complete a cycle.
print("Checking fuel level...")
enoughFuel = false
while enoughFuel == false do
if turtle.getFuelLevel() > (7+digDepth*2) then
enoughFuel = true
else
print("Inadequate fuel to cycle")
print("Please place a fuel source in me.")
sleep(5)
shell.run("refuel all")
end
end
end

function dumpInvToChest() --place all items in inv into enderchest (retrieved from inv slot 16)
print("Clearing inventory...")
turtle.dig()
if turtle.getFuelLevel() < maxFuel then
shell.run("refuel all")
end
turtle.select(16)
turtle.place()
sleep(1)
for i = 1,15 do
turtle.select(i)
turtle.drop()
end
turtle.select(16)
turtle.dig()
end

function digCycle() --Dig one cycle & move into pos for next & dump inv to enderchest
print("Begining dig cycle...")
keepDigging = true
yCurPos = digDepth
--Diging part of cycle
while keepDigging == true do
turtle.digDown()
turtle.dig()
if turtle.down() == false then
turtle.dig()
keepDigging = false
end
if keepDigging == true then
yCurPos = yCurPos-1 --If turtle moved down, lower the Y height var by 1
end
if yCurPos == 0 then
keepDigging = false
end
end
--Return part of cycle
turtle.dig()
turtle.turnLeft()
turtle.turnLeft()
while yCurPos < digDepth do
turtle.dig()
turtle.digUp()
turtle.up()
yCurPos = yCurPos+1
end
--call the dump to enderchest func. to clear inv.
turtle.turnLeft()
turtle.turnLeft()
dumpInvToChest()
end

function movePos() --Move into the next position
print("Moving position...")
if fwdCycleCurrent+1 < fwdCycleTarget then --move up if we haven't met cycle count
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
turtle.dig()
turtle.forward()
fwdCycleCurrent=fwdCycleCurrent+1
elseif lftCyclePos+1 < lftCycleTarget and oddRowNum == false then --Get into pos for return line
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
turtle.turnLeft()
turtle.dig()
turtle.forward()
lftCyclePos = lftCyclePos+1
fwdCycleCurrent = 0
oddRowNum = true
elseif lftCyclePos+1 < lftCycleTarget and oddRowNum == true then --this part is for the return line
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
turtle.turnRight()
turtle.dig()
turtle.forward()
lftCyclePos = lftCyclePos+1
fwdCycleCurrent = 0
oddRowNum = false
else
miningComplete = true
print("Mining Complete.")
end
end

shell.run("refuel all") --Initial Fuel up

while miningComplete == false do
checkFuel()
digCycle()
movePos()
end