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 

auto msg .

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


Joined: 30 Apr 2015
Posts: 30
Location: Pakistan

PostPosted: Mon Aug 29, 2016 10:44 am    Post subject: auto msg . Reply with quote

Code:

# Set your channel
set send_chans "#sukoon"

# Set Timer one line after X mins
set send_time "2"

# Set Your Messages. You can insert more messages caz is every X min an random message from the list..
set send_msg {
"Hello"
"How are u"
"what do u do"
"your are only mine"
}

#########################################
#!!!!!!DO NOT EDIT AFTER THIS LINE!!!!!!#
#########################################

if {![string match "*time_send*" [timers]]} {
 timer $send_time time_send
}

proc time_send {} {
 global send_msg send_chans send_time
 if {$send_chans == "*"} {
  set send_temp [channels]
 } else {
  set send_temp $send_chans
 }
 foreach chan $send_temp {
  set send_rmsg [lindex $send_msg [rand [llength $send_msg]]]
 puthelp "PRIVMSG $chan :$send_rmsg"
timer $send_time time_send
return 1
 }
 }

this is ok tcl working fine .. just need litel change on it it's playing msg randomly .. and like to be play by order ..

1st Hello
2nd How Are you
3rd what do u do
4th you are only mine

if any helper can help me for it . i will be so kind for him .

Thank u
Back to top
View user's profile Send private message Yahoo Messenger
SpiKe^^
Owner


Joined: 12 May 2006
Posts: 792
Location: Tennessee, USA

PostPosted: Mon Aug 29, 2016 6:58 pm    Post subject: Auto message next line Reply with quote

That will require that the script has some memory of what line it sent last...
Code:

 # Set your channel
 set send_chans "#sukoon"

 # Set Timer one line after X mins
 set send_time "2"

 # Set Your Messages. You can insert more messages caz is every X min an random message from the list..
 set send_msg {
 "Hello"
 "How are u"
 "what do u do"
 "your are only mine"
 }

 #########################################
 #!!!!!!DO NOT EDIT AFTER THIS LINE!!!!!!#
 #########################################

 if {![string match "*time_send*" [timers]]} {
  timer $send_time time_send
 }

 # set a global variable to track the next line to say #
 if {![info exists send_next]} {  set send_next 0  }

 proc time_send {} {
  global send_msg send_chans send_time send_next

  # save the msg line to say now #
  set nextline [lindex $send_msg $send_next]

  # and advance the global var to the next msg line number #
  incr send_next
  if {$send_next >= [llength $send_msg]} {  set send_next 0  }

  if {$send_chans == "*"} {
   set send_temp [channels]
  } else {
   set send_temp $send_chans
  }
  foreach chan $send_temp {

   puthelp "PRIVMSG $chan :$nextline"

  }

  # move the timer set and return to outside of the foreach loop #
  timer $send_time time_send
  return 1

 }
 

_________________
SpiKe^^

Get BogusTrivia 2.06.4.7 at www.mytclscripts.com
or visit the New Tcl Acrhive at www.tclarchive.org
.
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