i want to know how to store stuff to a database oor ini or whatever
like in mirc theirs
Code: Select all
/writeini <file> <section> <item> <value>
Code: Select all
/writeini <file> <section> <item> <value>
how would i go about making a multi chan topic scriptarfer wrote:Been there, done that, got the tee shirt (if you mean store in a file)
http://forum.egghelp.org/viewtopic.php?t=16624
If you mean to a database proper then you need an addon such as the tcl interface for mysql.
Code: Select all
on *:TEXT:!topic *:#: {
if ($nick isop # || $nick ishop #) {
writeini network $+ .ini # topic $2-
topic # $readini($network $+ .ini, #, topic) // $readini($network $+ .ini, #,owner) is $readini($network $+ .ini, #, status) // $readini($network $+ .ini, #, static)
}
else msg # Sorry $nick $+ , you must be an OP(@) or HOP(%) to use this command.
}
Code: Select all
proc TOPICDEFAULTS:proc { nick chan host handel text } {
set $chan(topic) "Channel Topic"
set $chan(divider) "||"
set $chan(owner) "The topic"
set $chan(verb) "has"
set $chan(status) "been set."
set $chan(header) "Topic:"
set $chan(static) "Welcome to the channel."
putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"
}
proc TOPIC:proc { nick chan host handel text } {
if ([isop $nick $chan]) {
set $chan(topic) $text
putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"
}
else {
putserv "PRIVMSG $chan Error: You are not channel operator."
}
}
proc HEADER:proc { nick chan host handel text } {
if ([isop $nick $chan]) {
set $chan(header) $text
putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"
}
else {
putserv "PRIVMSG $chan Error: You are not channel operator."
}
}
proc OWNER:proc { nick chan host handel text } {
if ([isop $nick $chan]) {
set $chan(owner) $text
putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"
}
else {
putserv "PRIVMSG $chan Error: You are not channel operator."
}
}
proc VERB:proc { nick chan host handel text } {
if ([isop $nick $chan]) {
set $chan(verb) $text
putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"
}
else {
putserv "PRIVMSG $chan Error: You are not channel operator."
}
}
proc STATUS:proc { nick chan host handel text } {
if ([isop $nick $chan]) {
set $chan(status) $text
putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"
}
else {
putserv "PRIVMSG $chan Error: You are not channel operator."
}
}
proc STATIC:proc { nick chan host handel text } {
if ([isop $nick $chan]) {
set $chan(static) $text
putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"
}
else {
putserv "PRIVMSG $chan Error: You are not channel operator."
}
}
proc DIVIDER:proc { nick chan host handel text } {
if ([isop $nick $chan]) {
set $chan(divider) $text
putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider) $chan(owner) $chan(verb) $chan(status) $chan(divider) $chan(static)"
}
else {
putserv "PRIVMSG $chan Error: You are not channel operator."
}
}
bind pub - "!topic" TOPIC:proc
bind pub - "!header" HEADER:proc
bind pub - "!owner" OWNER:proc
bind pub - "!tdefaults" TOPICDEFAULTS:proc
bind pub - "!verb" VERB:proc
bind pub - "!status" STATUS:proc
bind pub - "!static" STATIC:proc
Code: Select all
putserv "TOPIC $chan $chan(header) $chan(topic) $chan(divider)..."
Code: Select all
putserv "TOPIC $chan :$::chan(header) $::chan(topic) $::chan(divider)..."
Code: Select all
set $chan(topic) ...
Code: Select all
#set the variable in the local namespace, will not persist in between calls:
set chan(topic) ...
#set the variable in globalspace, which will persist in between calls:
set ::chan(topic) ...
Code: Select all
proc TOPICDEFAULTS:proc {nick host handle chan text} {