Author Topic: Small Bot Add-On Scripts For Basic Actions  (Read 9990 times)

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Small Bot Add-On Scripts For Basic Actions
« on: April 28, 2008, 07:59:53 PM »
Little Scripts I Made For One Of My IceChat Bots... Some,, If Not All Are Customized To You Only... Be Sure To Add Your Nick Somewhere (Or Host, Modify Them If You Like)



Bot Join Script: Type !join and A Channel Name (ex. !join #SamF)

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Not Nickname = "InsertNickHere" Then Exit Sub
If Left(Message,6) = "!join " and Len(message) > 6 then
JoinCh = Mid(Message,6)
sendCommand "/msg " & channel & "  Joining Channel: " & JoinCh & " Now!",ServerNumber
SendCommand "/join " & JoinCh,ServerNumber
End If
End Sub

Bot Part Script... Type !part And The Channel To Part The channel... (ex. !part #SamF)

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Not Nickname = "InsertNickHere" then Exit Sub
If Left(Message,6) = "!part " and Len(Message) > 6 Then
Leave = Mid(Message,6)
SendCommand "/part " & Leave & " Part Command Recieved From: " & Nickname,ServerNumber
End If
End Sub

Makes The Bot De-Halfop Itself Using The Command !cmd: dehop

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Not Nickname = "InsertNickHere" then Exit Sub
If Message = "!cmd: dehop" then
SendCommand "/mode # -h BotNickHere",ServerNumber
End If
End Sub

Makes The Bot Re-Halfop Itself using !cmd: hop (If On Access List As A HOP)

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Not Nickname = "TheCellist42" then exit Sub
If Message = "!cmd: hop" then
SendCommand "/cs halfop #mcintec",servernumber
End If
End Sub

Makes The Bot Deop It Self Using !cmd: deop

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Not Nickname = "YourNickHere" then Exit sub
If Message = "!cmd: deop" then
SendCommand "/mode # -o BotNickHere",ServerNumber
end If
End Sub

This Script Makes The Bot Reop Itself With !cmd: deop (Only If On Access List)

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
If Not Nickname = "YourNickHere" then Exit Sub
If Message = "!cmd: op" then
SendCommand "/cs op #",ServerNumber
End If
End Sub

Here They Are... Ill Post More Really Basic Scripts As I Decide To Make Them

-Sam
« Last Edit: April 29, 2008, 08:52:29 PM by Snerf »
~ Sam
~ Visit my website at http://www.TheCellist42.com

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Small Bot Add-On Scripts For Basic Actions
« Reply #1 on: April 29, 2008, 11:21:29 AM »
I have a suggestion that would make these scripts a bit more practical. You could a way to identify yourself with the bot, that way it wouldn't matter if you changed your nick.
Something like this:

Code: [Select]
If GetInifile("owner.ini","Owner","Owner_password","N/A") = "N/A" then WriteIniFile "owner.ini","Owner","Owner_password","your_password_here"

Sub ONQUERY(Message,Nickname,Host,ServerNumber)
If Left(Message,10) = "!identify " and Len(Message) > 10 then
  Password = GetInifile("owner.ini","Owner","Owner_password","") 'get the password
  If Mid(Message,11) = Password then WriteIniFile "owner.ini","Owner","Owner",Nickname 'check that the password matches and then record the nickname
End If

'Logging out:
If Message = "!logout" then
OwnerNick = GetIniFile("owner.ini","Owner","Owner","")
If NickName = OwnerNick then WriteInifile "owner.ini","Owner","Owner",""
End If
End Sub

Then you could make the ONTEXT subs like this:

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
'the code for the trigger
OwnerNick = GetIniFile("owner.ini","Owner","Owner","")
If NickName = OwnerNick then
.
.
.
End If
End Sub

The you should also add this part to make it track your nickname (this will only work if you're in at least one channel the bot is in)

Code: [Select]
Sub ONNICK(NewNick,OldNick,ServerNumber)
OwnerNick = GetIniFile("owner.ini","Owner","Owner","")
If OldNick = OwnerNick then WriteIniFile "owner.ini","Owner","Owner",NewNick
End Sub
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

TheCellist42

  • Full Member
  • ***
  • Posts: 143
    • TheCellist42.com
Re: Small Bot Add-On Scripts For Basic Actions
« Reply #2 on: April 29, 2008, 10:57:43 PM »
...
~ Sam
~ Visit my website at http://www.TheCellist42.com

Jatin

  • Newbie
  • *
  • Posts: 9
Re: Small Bot Add-On Scripts For Basic Actions
« Reply #3 on: August 29, 2012, 09:39:35 AM »
hey guys if i made a script like this one its just a simple 1 coz i am new
on *:INPUT:!hello:#JM,#satruck,#mappers,#Sharp:/say 53HEY guys i am back wassup huh
End if
End sub

then if i want this command to be said by my bot named J-Bot then how to do tht ??

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Small Bot Add-On Scripts For Basic Actions
« Reply #4 on: August 29, 2012, 10:31:48 AM »
With ON INPUT, and using end if, and all that, that is VB Script (icechat 5 style), the ON .. type scripts are mirc style (icechat 7 style), you can not mix the two. you can also use the VB Script event OUTTEXT.

When you are in the script editor , look under the Menu Script Events, and you can view the proper syntax for the script events.
The IceChat God

Jatin

  • Newbie
  • *
  • Posts: 9
Re: Small Bot Add-On Scripts For Basic Actions
« Reply #5 on: August 30, 2012, 12:57:16 AM »
ok thnx