egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

mIRC invite script to TCL to load with eggdrop

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
DaKevinn
Voice


Joined: 05 Mar 2012
Posts: 2

PostPosted: Mon Mar 05, 2012 11:25 am    Post subject: mIRC invite script to TCL to load with eggdrop Reply with quote

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:
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 Very Happy

Greets DaKevinn
Back to top
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Mon Mar 05, 2012 1:27 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
DaKevinn
Voice


Joined: 05 Mar 2012
Posts: 2

PostPosted: Mon Mar 05, 2012 2:35 pm    Post subject: Reply with quote

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:
Quote:
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:
Quote:
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:
Quote:
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.
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Mon Mar 05, 2012 5:04 pm    Post subject: Re: mIRC invite script to TCL to load with eggdrop Reply with quote

DaKevinn wrote:

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



Experiment with this:

Code:


# 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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber