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 

ad.tcl help

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
FuE-
Halfop


Joined: 27 Nov 2004
Posts: 57

PostPosted: Mon Aug 01, 2005 8:04 am    Post subject: ad.tcl help Reply with quote

hey, i use tclscripts.com's ad.tcl script when the bot announce every 120 secs its like this

Code:
(14:02:10) (@Dahlen) [b][u]Paket::1[/u][/b]
(14:02:12) (@Dahlen) bla bla bla


And i just want the "Paket::1" shall be like plain text no bold or underline

and btw, i must do !ad <name with no space> <desc>

why cant i have just

Code:
!ad You are the [censored] yes, you are


please help me with the codes, tnx

Code:

## ad.tcl v1.0 by strikelight  ([sL]@EfNet)
#
# -----------------------------------------
# web  : http://www.TCLScript.com
# EFNet: #Scripting
# -----------------------------------------
# Description:
#
# Small script used to advertise urls in a channel
# such as shell companies at a defined time interval.
#
# Default usage:
#
# Add:
# /msg <bot> !ad <url> <description>
#
# Remove:
# /msg <bot> !delad <url>
#
##

## ---  START EDITTING HERE --- ##

# time in seconds to display an ad to channels #

set adtime 120


# channels to advertise in #

set adchans "#shellx"


# flag of user required to add an advertisement via msg #

set adflag m


# message trigger used to add an advertisement #
# (format /msg bot <command> <url> <ad description>)

set admsgcmd "!ad"

# message trigger used to delete an advertisement #
# (format /msg bot <command> <url>)

set deladmsgcmd "!delad"


## ---  STOP EDITTING HERE --- ##

set adidx 0
proc loadads {} {
  global adlist
  set adlist ""
  if {![file exists "ad.txt"]} {return 0}
  set infile [open "ad.txt" r]
  while {![eof $infile]} {
    gets $infile dataline
    if {$dataline != ""} {lappend adlist $dataline}
  }
  close $infile
  return 1
}

proc saveads {} {
  global adlist
  set outfile [open "ad.txt" w]
  foreach ad $adlist {if {$ad != ""} {puts $outfile "$ad"}}
  close $outfile
  return 1
}

proc addisplay {} {
  global adchans adlist adidx adtime
  utimer $adtime "addisplay"
  if {$adlist == ""} {return 0}
  foreach chan $adchans {
    puthelp "PRIVMSG $chan :\002\037[split [lindex [lindex $adlist $adidx] 0]]\037\002"
    puthelp "PRIVMSG $chan :[split [lrange [lindex $adlist $adidx] 1 end]]"
  }
  set adidx [expr $adidx + 1]
  if {$adidx >= [llength $adlist]} {set adidx 0}
  return 1
}

proc utimerexists {timer_proc} {
  foreach j [utimers] {if {[string compare [lindex $j 1] $timer_proc] == 0} {return [lindex $j 2]}}
  return
}

bind msg $adflag $admsgcmd addad
proc addad {unick user handle argz} {
  global adlist botnick admsgcmd
  set url [split [lindex $argz 0]]
  set addesc [split [lrange $argz 1 end]]
  if {($url == "") || ($addesc == "")} {
    puthelp "NOTICE $unick :Invalid. Format: /msg $botnick $admsgcmd <url> <ad description>"
    return 0
  }
  foreach turl $adlist {
    set aurl [string tolower [lindex $turl 0]]
    if {$aurl == [string tolower $url]} {
      puthelp "NOTICE $unick :Error. Site is already added."
      return 0
    }
  }
  lappend adlist "$url $addesc"
  saveads
  puthelp "NOTICE $unick :Added: $url - $addesc"
  return 1
}

bind msg $adflag $deladmsgcmd delad
proc delad {unick user handle argz} {
  global adlist botnick admsgcmd
  set url [split [lindex $argz 0]]
  if {$url == ""} {
    puthelp "NOTICE $unick :Invalid. Format: /msg $botnick $deladmsgcmd <url>"
    return 0
  }
  set newadlist ""
  foreach turl $adlist {
    set aurl [string tolower [lindex $turl 0]]
    if {$aurl != [string tolower $url]} {
     lappend newadlist $turl
    }
  }
  set adlist $newadlist
  saveads
  puthelp "NOTICE $unick :Deleted: $url"
  return 1
}

loadads
if {[utimerexists "addisplay"] == ""} {utimer $adtime "addisplay"}

putlog "ad.tcl v1.0 by strikelight now loaded"
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Mon Aug 01, 2005 9:21 am    Post subject: Reply with quote

Remove the \002\037 tags from the messages and the bold and underline should be gone. As for the second thing, that's how this script works, live with it Razz
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
FuE-
Halfop


Joined: 27 Nov 2004
Posts: 57

PostPosted: Tue Aug 02, 2005 9:59 am    Post subject: Reply with quote

if i wanna display all links in ad.txt

ex !adlist in privmsg, how shall i do then =)
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Tue Aug 02, 2005 10:33 am    Post subject: Reply with quote

replace NOTICE with PRIVMSG.
_________________
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:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive 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