This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

mIRC invite script to TCL to load with eggdrop

Requests for complete scripts or modifications/fixes for scripts you didn't write. Response not guaranteed, and no thread bumping!
Post Reply
D
DaKevinn
Voice
Posts: 2
Joined: Mon Mar 05, 2012 11:17 am

mIRC invite script to TCL to load with eggdrop

Post by DaKevinn »

Hello,

I have a mIRC script and want to load it with Eggdrop.
It need to auto-join on invite. And I want it also enables the bMotion then.

This is the mIRC script:

Code: Select all

on *:INVITE:#: {
  if (!$hget(spamcheck,$chan)) {
    hadd -mz spamcheck $chan 60
    hadd -mu5 invite $chan $nick
    join $chan
  }
  else {
    .notice $nick 4,1I was just invited to $chan $+ .Please wait $duration($hget(spamcheck,$chan)) before inviting me again.
  }
}

on *:JOIN:#: {
  if ($nick == $me) && ($hget(invite,$chan)) {
    $+(.timer_checkop_,$chan) 1 1 check_op $hget(invite,$chan) $chan
  }
}

alias check_op {
  if ($1 isop $2) || ($1 ishop $2) {
    msg $2 4,1Hi there im $me $+ . I was invited by $1 $+ .Try +commands for a list of my commands and +opcom for the list of commands who only can be used by a Op.
  }
  else {
    part $2 I was invited by a non-op. Please try again with a opped Nick.
  }
}
I would love if someone translate it for me :D

Greets DaKevinn
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Since this is a TCL and eggdrop related forum, I honestly doubt there are many people that understand much of the mIRC scripting language, so it would help you a lot if you will tell us what happens inside it.

PS: Next time please post in Script Requests section. Thank you.
Once the game is over, the king and the pawn go back in the same box.
D
DaKevinn
Voice
Posts: 2
Joined: Mon Mar 05, 2012 11:17 am

Post by DaKevinn »

caesar wrote:Since this is a TCL and eggdrop related forum, I honestly doubt there are many people that understand much of the mIRC scripting language, so it would help you a lot if you will tell us what happens inside it.

PS: Next time please post in Script Requests section. Thank you.
Sorry for the wrong section.

The script is really simple. The bot will join on /invite nick #chan.
Then he looks if the inviter is operator or higher in the channel. If not, the bot will leave with this message:
I was invited by a non-op. Please try again with a opped Nick.
If the inviter is a operator, it will stay wth this message:
Hi there im Bot. I was invited by DaKevinn. Try +commands for a list of my commands and +opcom for the list of commands who only can be used by a Op.
If the bot twice is invited in 60 seconds, it will says:
I was just invited to #chan.Please wait <seconds after first invite> before inviting me again.
I just don't want to do .+chan #chan and .chanset #chan +bmotion, it must go automatic.
Thanks.
w
willyw
Revered One
Posts: 1203
Joined: Thu Jan 15, 2009 12:55 am

Re: mIRC invite script to TCL to load with eggdrop

Post by willyw »

DaKevinn wrote: ...
It need to auto-join on invite. And I want it also enables the bMotion then.
...

Experiment with this:

Code: Select all


# March 5, 2012
# http://forum.egghelp.org/viewtopic.php?t=18870


# Be sure that bmotion is loaded before this script.
# This script attempts to set user defined flag +bmotion.  If bmotion does not exist first, it is a Bad Thing.


bind raw - invite the341

set oldinvitetime [expr [unixtime] - 60]
set oldchan ""


proc the341 {from key text} {
global botnick oldinvitetime oldchan

	set chan [string trimleft [lindex [split $text] 1] :]
	set nick [lindex [split $from !] 0]


	set invitetime [unixtime]
	set diff [expr $invitetime - $oldinvitetime]
   

     if {$diff < 60} {
		putserv "privmsg $nick :I was just invited to $oldchan. Please wait [expr 60 - $diff] seconds before inviting me again."
         return 0
         }
      
      set oldinvitetime $invitetime
      set oldchan $chan

	channel add $chan
     	utimer 3 [list do_check $nick $chan]
}



proc do_check {nick chan} {
global botnick

	if {[isop $nick $chan] } {
		putserv "privmsg $chan :Hi there I'm $botnick. I was invited by $nick. Try +commands for a list of my commands and +opcom for the list of commands who only can be used by an Op." 
		channel set $chan +bmotion		
          } else {
		putserv "privmsg $chan :I was invited by a non-op. Please try again with an opped Nick."
		channel remove $chan     
     }

}



Tested very briefly, on just one server.
Post Reply