mIRC Homepage
Posted By: Panic Calling all Scripters - 29/08/07 06:00 PM
Well i need a script making my bot is set to auto join and i want so when i enter a channel that someone has invited my bot to it and if i don't want to the bot to auto join that channel anymore i want if Panic and trollman118 say !stopjoin in that channel we don't want the bot to join anymore it will say the bot called CrazyMan in the channel I will not longer join this room on invite anymore! and leave the channel and never join the channel on invite again i know this can be done because a friend of mine has done it but he won't give me the script this script will be put in my bot

Thank you so much if you can do this!

Thank you
Panic
ctcwcu head
Posted By: RusselB Re: Calling all Scripters - 29/08/07 09:11 PM
While this isn't exactly what you're asking for, while I, and probably others, are working on your request, temporarily you might find my Auto-Part snippet useful.
Posted By: Lpfix5 Re: Calling all Scripters - 29/08/07 10:10 PM
Originally Posted By: Panic
Well i need a script making my bot is set to auto join and i want so when i enter a channel that someone has invited my bot to it and if i don't want to the bot to auto join that channel anymore i want if Panic and trollman118 say !stopjoin in that channel we don't want the bot to join anymore it will say the bot called CrazyMan in the channel I will not longer join this room on invite anymore! and leave the channel and never join the channel on invite again i know this can be done because a friend of mine has done it but he won't give me the script this script will be put in my bot

Thank you so much if you can do this!

Thank you
Panic
ctcwcu head


Simple and fast we can go complicated if you want but tis not needed.

Code:
on *:INVITE:#:{
  if ($wildtok(%c.inv,$+(*,$right($chan,-1),*),1,32)) { part $chan | halt }
}

on *:TEXT:*:#:{
  if ($1 == !stopjoin) && ($nick == trollman118) || ($nick == Panic) {  %c.inv = %c.inv $right($chan,-1) | msg # I will no longer join this room on invite anymore! }
}


In the first snipplet I used part $chan | halt part $chan might not be needed but its there for you to play around with.

Also you can use write/read commands to file or hash in order to store the channels in them rather then var's but if you continue using a variable as is then in return I would make a var lenght check always and if reaches x amount to make a new var.

Therefore I suggest writting to file you'll just have to change a few things not much.

thumbs up
Posted By: Panic Re: Calling all Scripters - 30/08/07 08:03 AM
So if me or trollman118 enters a room that my bot is and and we don't want him in we type !stopjoin the bot will say in that room I will no longer join this room on invite anymore! and leave and not enter on invite anymore

Thanks
Panic
ctcwcu head
Posted By: SladeKraven Re: Calling all Scripters - 30/08/07 08:58 AM
You should turn off the Auto Join feature and use the On Invite event because the built in feature will join no matter what you have in the Invite event as far as I know. The best way to work around that is to join the channels on invite that aren't in your list.

1. /ajinvite off
2. Put the following in remotes.

Code:
On *:Invite:#: {
  if (!$istok(%stopjoin,#,44)) join #
}

ON *:Text:!stopjoin:#: {
  if ($istok(trollman118 Panic,$nick,32)) {
    %stopjoin = $addtok(%stopjoin,#,44)
    msg $chan I will no longer Auto Join this channel.
    part #
  }
}
Posted By: Panic Re: Calling all Scripters - 30/08/07 09:20 AM
Thank you this works great the only thing is can it be something when we type in the channel !allowjoin it then joins the channel again can this be made

Thank you for your fast responce
Panic
ctcwcu head
Posted By: SladeKraven Re: Calling all Scripters - 30/08/07 09:51 AM
Well yes and no.

Since the channel would currently stored in the %stopjoin variable the bot wont be in the channel. But what you could to is send a private message to the bot having !allowjoin <#channel> remove it from the list then join the channel.

This can be achieved by:


Code:
ON *:Text:!allowjoin &:?: {
  if ($istok(trollman118 Panic,$nick,32)) && ($istok(%stopjoin,$2,44)) {
    %stopjoin = $remtok(%stopjoin,$2,44)
    join $2
  }
}
Posted By: Panic Re: Calling all Scripters - 30/08/07 11:04 AM
I have sent the bot /notice Crazyman !allowjoin #channel but it will not work and the bot still will not join the channel on invite

Thanks
Panic
ctcwcu head
Posted By: SladeKraven Re: Calling all Scripters - 30/08/07 11:24 AM
It doesn't trigger on notices it triggers on private messages.

/msg Crazyman !allowjoin #channel.

If you want it for notices, change:

Code:
ON *:Text:!allowjoin &:?: {


To:

Code:
ON *:Notice:!allowjoin &:?: {
Posted By: Panic Re: Calling all Scripters *DELETED* *DELETED* - 30/08/07 11:30 AM
Post deleted by Panic
Posted By: Panic Re: Calling all Scripters *DELETED* - 30/08/07 11:32 AM
Post deleted by Panic
Posted By: Panic Re: Calling all Scripters - 30/08/07 11:39 AM
Nevermind that last post is there one more thing that you can script when the bot joins the channel on invited can it notice Panic who invited it and the channel it joined

Thank you (ignore the last post)
Panic
ctcwcu head
Posted By: SladeKraven Re: Calling all Scripters - 30/08/07 11:47 AM
Code:
On *:Invite:#: {
  if (!$istok(%stopjoin,#,44)) {
    join #
    .notice Panic I was invited to # by $nick
  }
}

ON *:Text:!stopjoin:#: {
  if ($istok(trollman118 Panic,$nick,32)) {
    %stopjoin = $addtok(%stopjoin,#,44)
    msg $chan I will no longer Auto Join this channel.
    part #
  }
}

ON *:Text:!allowjoin &:?: {
  if ($istok(trollman118 Panic,$nick,32)) && ($istok(%stopjoin,$2,44)) {
    %stopjoin = $remtok(%stopjoin,$2,44)
    join $2
  }
}
Posted By: Panic Re: Calling all Scripters - 30/08/07 11:57 AM
Thank you so much you are a Amazing Scripter

Thanks Again
Panic
ctcwcu head
Posted By: Panic Re: Calling all Scripters - 30/08/07 12:14 PM
Last thing can it notice me when it gets Kicked or Banned from a channel can it tell me who kicked or banned it and what channel please if you can do this!

You are the best!

Thanks
Panic
ctcwcu head
Posted By: SladeKraven Re: Calling all Scripters - 30/08/07 12:46 PM
Code:
ON !*:Kick:#: {
  if ($knick == $me) .notice Panic I was kicked from $chan by $nick
}

ON !*:Ban:#:{  
  if ($banmask iswm $ial($me)) { .notice Panic I was banned from $chan by $nick }
}
© mIRC Discussion Forums