Author Topic: Updated Chuck Norris Script  (Read 2648 times)

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Updated Chuck Norris Script
« on: June 16, 2008, 03:47:07 PM »
This Version Was Edited By HackBenjamin and made a bot more random. Have Fun.

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)

if Instr(lcase(Message),"!chuck") then
if Instr(lcase(Message),"!chuckinfo") then
else
  if left(lcase(message),6) = "!chuck" then
    if lcase(Message) = "!chuck" then
     Randomize
      rndnum = Int(Rnd * GetIniFile("chuck.ini","control","chucks","0")) + 1
      chuck = GetIniFile("chuck.ini","master","" & rndnum & "","NA")
    end if
    if len(message) > 7 then
      if Instr(lcase(Message),"#") then
        temp1 = Mid(lcase(Message),8)
        temp2 = instr(lcase(Message),"#")
        if temp2 > 0 then
          num = Mid(Message,temp2+1)
          tmp = instr(lcase(temp1),"#")
          tempvar = Mid(Message,8,tmp - 2)
          temp3 = GetIniFile("chuck.ini","" & tempvar & "","" & num & "","NA")
          chuck = GetIniFile("chuck.ini","master","" & temp3 & "","NA")
          temptitle = GetIniFile("chuck.ini","control","" & tempvar & "","0")
          title = "" & tempvar & " (" & num & " of " & temptitle & ")"
        end if
      else
      Randomize
      rndnum = Int(Rnd * GetIniFile("chuck.ini","control","" & Mid(lcase(Message),8) & "","0")) + 1
      temp1 = GetIniFile("chuck.ini","" & Mid(lcase(Message),8) & "","" & rndnum & "","NA")
      chuck = GetIniFile("chuck.ini","master","" & temp1 & "","NA")
      title = Mid(Lcase(Message),8)
      end if
    end if
    if quote = "NA" then
      SendCommand "/msg " & Channel & " No Entry Found.", ServerNumber
    else
      SendCommand "/msg " & Channel & " " & chuck & "", ServerNumber
    end if
  end if
end if
end if

if Instr(lcase(Message),"!chuckinfo") then
  if left(lcase(message),10) = "!chuckinfo" then
    if len(message) > 11 then
      if Instr(lcase(Message),"#") then
        temp1 = Mid(lcase(Message),12)
        temp2 = instr(lcase(Message),"#")
        if temp2 > 0 then
          num = Mid(Message,temp2+1)
          tmp = instr(lcase(temp1),"#")
          tempvar = Mid(Message,12,tmp - 2)
          info = GetIniFile("chuckinfo.ini","" & tempvar & "","" & num & "","No Information Available")
        end if
      else
        info = "Third Paramiter Not Specified, Syntax: !chuckinfo chuck #<number>"
      end if
    else
      if lcase(Message) = "!chuckinfo" then
        info = "This will retrieve information about a chuck. Syntax: !chuckinfo chuck #<number>"
      end if
    end if
    SendCommand "/msg " & Channel & " " & info & "", ServerNumber
  end if
end if

if Instr(lcase(Message),"!addchuck") then
  if left(lcase(message),9) = "!addchuck" then
    if len(message) > 10 then
      if Instr(lcase(Message),"#") then
         temp1 = Mid(lcase(Message),11)
         temp2 = instr(lcase(Message),"#")
        chuck = Mid(Message,temp2+1)
         tmp = instr(lcase(temp1),"#")
        category = Mid(Message,11,tmp - 2)
        control = GetIniFile("chuck.ini","control","" & category & "","0") + 1
        chucks = GetIniFile("chuck.ini","control","chucks","0") + 1
        master = GetIniFile("chuck.ini","control","chucks","0") + 1
         ttime = GetIdentifier("$time",ServerNumber)
         tdate = GetIdentifier("$date",ServerNumber)
         tserver = GetIdentifier("$network",ServerNumber)
        info = "This Chuck Submitted By: " & Nickname & " On: " & Channel & ", " & tserver & " At: " & ttime & ", " & tdate & "."
   if len(chuck) > 1 then
        WriteIniFile "chuckinfo.ini","" & category & "","" & control & "","" & info & ""
        WriteIniFile "chuck.ini","control","" & category & "","" & control & ""
        WriteIniFile "chuck.ini","" & category & "","" & control & "","" & master & ""
        WriteIniFile "chuck.ini","master","" & master & "","" & chuck & ""
        WriteIniFile "chuck.ini","control","chucks","" & chucks & ""
        SendCommand "/notice " & Nickname & " Chuck has been filed as: " & category & " #" & control & ".", ServerNumber
   else
        SendCommand "/notice " & Nickname & " No Chuck Specified.", ServerNumber
end if
      end if
    else
      if lcase(Message) = "!addchuck" then
        SendCommand "/notice " & Nickname & " Syntax: !addchuck chuck #<chuck>", ServerNumber
        SendCommand "/notice " & Nickname & " Do Not Include a space between the pound sign and <chuck>.", ServerNumber
      end if
    end if
  end if
end if

End Sub

-Sam
~ Sam
~ Visit my website at http://www.TheCellist42.com