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 

is it posiable someone help me with SAMODE?

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


Joined: 04 Sep 2022
Posts: 14
Location: London

PostPosted: Tue Feb 07, 2023 10:39 pm    Post subject: is it posiable someone help me with SAMODE? Reply with quote

I`m use this script fot ircop bot to get @ in every chan. Is it posiable to make it to get + in #opers. In every chan will get @, exempt #opers. In #opers has to be with +

Code:

bind join - * join:opbot
proc join:opbot { nick host hand chan } {
 
    if {$nick eq $::botnick} {
       putserv "SAMODE $chan +o $::botnick"
    }
 
}

_________________
if there's a will, there's a way.
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


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

PostPosted: Wed Feb 08, 2023 2:25 am    Post subject: Reply with quote

Code:

bind join - * join:opbot

proc join:opbot { nick host hand chan } {
   if {![isbotnick $nick]} return
   set mode [expr {[string equal -nocase $chan "#opers"] ? "+o" : "++"}]
   putserv "SAMODE $chan $mode $::botnick"
}

Replace the second '+' in '++' with whatever mode gives the bot the + flag cos honestly I don't know.
_________________
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
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1145
Location: France

PostPosted: Wed Feb 08, 2023 5:50 am    Post subject: Reply with quote

The "+" is a voice, so +v.

And you like complex code ?
Code:
bind join - * join:opbot

proc join:opbot { nick host hand chan } {
   if {![isbotnick $nick]} return
   set mode "+o"
   if {[string tolower $chan] eq "#opers"} { set mode "+v" }
   putserv "SAMODE $chan $mode $::botnick"
}

_________________
Eggdrop community - French IRC network
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


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

PostPosted: Thu Feb 09, 2023 5:33 am    Post subject: Reply with quote

You scared of the expr line? Smile

It's basically if condition do this else do something else just wrapped up nicely.
_________________
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
CrazyCat
Revered One


Joined: 13 Jan 2002
Posts: 1145
Location: France

PostPosted: Thu Feb 09, 2023 11:18 am    Post subject: Reply with quote

I'm not scared of it, but Valentin won't understand your code if you don't explain it.

I think that one of the first goals of this forum is to teach TCL to others, but I'm peharps wrong
_________________
Eggdrop community - French IRC network
Back to top
View user's profile Send private message Visit poster's website
caesar
Mint Rubber


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

PostPosted: Thu Feb 09, 2023 1:40 pm    Post subject: Reply with quote

You are right, in this case here's a more traditional approach:
Code:

bind join - * join:opbot

proc join:opbot { nick host hand chan } {
   if {![isbotnick $nick]} return
   if {[string equal -nocase $chan "#opers"]} {
      set mode "+v"
   } else {
      set mode "+o"
   }
   putserv "SAMODE $chan $mode $::botnick"
}

_________________
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
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