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 

Script Help

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Jerry
Voice


Joined: 23 Nov 2006
Posts: 9

PostPosted: Sat Nov 25, 2006 1:14 am    Post subject: Script Help Reply with quote

Code:
bind pub - !pcw pcw:world
bind pub - !world pcw:world
bind pub - !change change:world

proc pcw:world {nick host handle chan text} {
  puthelp "NOTICE $nick :\00303[\00312The current PCW World is $world.\00303] \00312- \00303[\00312The PCW was set by $pcwnick.\00303]
}

proc change:world {nick host handle chan text} {
  if {[isop $nick $chan] || [ishalfop $nick $chan] == 1} {
  set world $text
  set pcwnick $nick
  puthelp "PRIVMSG $chan :\00303[\00312PC World Update\00303]\00312 The PCW World has been updated!
} }


I tried it, and it doesnt seem to work. I also would like to know, how do I make it so that when an op/halfop changes the world, it will set the time since that world has been changed.

EX: !change 89
!pcw: The PCW World is (World). The PCW World was set (number of minutes ago) by $nick.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Nov 25, 2006 8:34 am    Post subject: Reply with quote

the world and pcwnick should be global variables and the brackets in the msgs should be skipped. (+ the quotes are not closed in the puthelp argument)
Code:
bind pub - !pcw pcw:world
bind pub - !world pcw:world
bind pub - !change change:world

proc pcw:world {nick host handle chan text} {
 global world pcwnick pcwtime
 puthelp "NOTICE $nick :\00303\[\00312The current PCW World is $world.\00303\] \00312- \00303\[\00312The PCW was set by $pcwnick at $pcwtime.\00303\]"
}

proc change:world {nick host handle chan text} {
 global world pcwnick pcwtime
 if {[isop $nick $chan] || [ishalfop $nick $chan] == 1} {
  set world $text
  set pcwnick $nick
  set pcwtime [ctime [unixtime]]
  puthelp "PRIVMSG $chan :\00303\[\00312PC World Update\00303\]\00312 The PCW World has been updated!"
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Jerry
Voice


Joined: 23 Nov 2006
Posts: 9

PostPosted: Sat Nov 25, 2006 4:14 pm    Post subject: Reply with quote

On the minutes part, I was looking for something like this:

The PCW world was set by $pcwnick 32secs ago.

In mIRC Form: $duration($ctime - %ctime) where %ctime = $ctime when the world was set.

EDIT: Also, Apparently, After I change the world, it doesnt Notice the person when I type !pcw. Even after I rehash the bot and set the world, it doesnt work.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sat Nov 25, 2006 9:15 pm    Post subject: Reply with quote

Code:
bind pub - !pcw pcw:world
bind pub - !world pcw:world
bind pub - !change change:world

proc pcw:world {nick host handle chan text} {
 global world pcwnick pcwtime
 puthelp "NOTICE $nick :\00303\[\00312The current PCW World is $world.\00303\] \00312- \00303\[\00312The PCW was set by $pcwnick [expr {[unixtime]-[clock scan $pcwtime]}] ago.\00303\]"
}

proc change:world {nick host handle chan text} {
 global world pcwnick pcwtime
 if {[isop $nick $chan] || [ishalfop $nick $chan] == 1} {
  set world $text
  set pcwnick $nick
  set pcwtime [ctime [unixtime]]
  puthelp "PRIVMSG $chan :\00303\[\00312PC World Update\00303\]\00312 The PCW World has been updated!"
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Jerry
Voice


Joined: 23 Nov 2006
Posts: 9

PostPosted: Sat Nov 25, 2006 11:35 pm    Post subject: Reply with quote

Ok so that displays the seconds. I want it to display like this: 1hr 2min 37secs
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Sun Nov 26, 2006 10:46 am    Post subject: Reply with quote

And that's exactly what you have Smile
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help 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