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 

im in need of a timed event
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
caesar
Mint Rubber


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

PostPosted: Wed Feb 16, 2011 8:04 am    Post subject: Reply with quote

The {* */2 * * *} is correct, cos without the '/' it would be every day at 02:00.
_________________
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
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Wed Feb 16, 2011 9:34 am    Post subject: Reply with quote

Thanks caesar but im trying to use your code but it dont seem to work :/

Code:
bind pub - .tssync switch:sync

proc switch:sync {nick uhost handle chan text} {
  switch -nocase [lindex [split $text] 0] {
    "on" {
      putserv "NOTICE $nick :TSSync turned on."
      bind cron - {* */1 * * *} cron:sync
    }
    "off" {
      putserv "NOTICE $nick :TSSync turned off."
      unbind cron - {* */1 * * *} cron:sync
    }
    default {
      putserv "NOTICE $nick :Use .tssync on/off."
    }
  }
}

proc cron:sync {minute hour day month weekday} {
  putserv "PRIVMSG OperServ :tssync"
}


Thanks
Gemster
Back to top
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Wed Feb 16, 2011 9:57 am    Post subject: Reply with quote

ohh and btw im having a little problem with this if statement:

Code:
if {[isop $nick ###1] == 1} {


well this works for ops in the channel ###1 but it does bnot work for any1 higher than chan ops.

Like say the user was a channel admin or channel founder then this if statement does not work :/

how could i add it for ops or higher ?

Thanks
Gemster
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Feb 16, 2011 10:16 am    Post subject: Reply with quote

Gemster wrote:

...
Code:
if {[isop $nick ###1] == 1} {


well this works for ops in the channel ###1 but it does bnot work for any1 higher than chan ops.

Like say the user was a channel admin or channel founder then this if statement does not work :/
...


Something to check:

(for an example, go here: http://eggwiki.org/Eggdrop.conf )


Look in eggdrop.conf for:
set opchars "@"

If it is as above, then try changing it to:
set opchars "@&~"
and then .restart your bot.

There is a brief explanation there in that well commented eggdrop.conf that you can find online with the link above.

I hope this helps.
Back to top
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Wed Feb 16, 2011 10:35 am    Post subject: Reply with quote

Quote:
Look in eggdrop.conf for:
set opchars "@"

If it is as above, then try changing it to:
set opchars "@&~"
and then .restart your bot.


i checked and it already says: set opchars "@&~"

These are correct for my server too but if u are a & or ~ ie: admin or founder it dont work.

It only works with ops, @ :/

Thanks
Gemster
Back to top
View user's profile Send private message
caesar
Mint Rubber


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

PostPosted: Wed Feb 16, 2011 10:49 am    Post subject: Reply with quote

Well, you have to start it with '.tssync on' Smile
_________________
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
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Wed Feb 16, 2011 10:56 am    Post subject: Reply with quote

caesar wrote:
Well, you have to start it with '.tssync on' Smile


I tryed
.tssync on
.tssync off
.tssync

and none worked, just nothing, no notice nothing.

Thanks
Gemster
Back to top
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Wed Feb 16, 2011 5:01 pm    Post subject: Reply with quote

caesar wrote:
Well, you have to start it with '.tssync on' Smile


error i found with your code

Tcl error [switch:sync]: bad option "-nocase": must be -exact, -glob, -regexp, or --

Thanks
Gemster
Back to top
View user's profile Send private message
thommey
Halfop


Joined: 01 Apr 2008
Posts: 73

PostPosted: Wed Feb 16, 2011 9:16 pm    Post subject: Reply with quote

For the switch error:
Code:

switch -nocase -- [lindex ..] {

"--" marks the end of options.

For the opchars issue, the opchars feature in Eggdrop is useless, it only works on the initial join of the bot, it doesn't even parse +a/+q changes. It's planned to be fixed, but in the meantime you can use a script like this which will provide you [isadmin] and [isowner] so you can use them in your code ({[isop $n $c] || [isadmin $n $c] || [isowner $n $c]}). It's adjusted for UnrealIRCd, if you have different modes you might need to adjust the "parsemodestr" procedure to account for other modes (raw 005 tells you about them).
Back to top
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Wed Feb 16, 2011 10:03 pm    Post subject: Reply with quote

[quote="Gemster"]
Quote:

...
i checked and it already says: set opchars "@&~"

These are correct for my server too but if u are a & or ~ ie: admin or founder it dont work.

It only works with ops, @ :/



I don't know what to say.

I just tried it with a bot of mine, in a channel I own.
The ircd is Unreal3.2.1
and I do not appear with @. I appear in my channel with ~.

In the partyline:
.tcl isop <mynick> #mychan
<botnick> Tcl: 1

So, the bot is detecting me as an op.

I'm sorry that it isn't working for you, and I wish I knew what else to tell you to try. If it is something simple, then it is escaping me at the moment.
Back to top
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Thu Feb 17, 2011 3:52 am    Post subject: Reply with quote

Ok, just figured it out, if the chan is reged and u are the owner u get ~ and when u join it sets u as +oq and as admin sets u as +oa so u always get the +o flag as op.

I had my auto op turned off so i had to manually set my self as owner thus i wasent getting the +o flag.

works fine now.

Thanks
Gemster
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
Goto page Previous  1, 2
Page 2 of 2

 
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