גירסא: 1.1
תיאור:
בוט חדשות פשוט וקל, מגדירים את הערוץ מוסיפים כמה שרוצים חדשות, ואז אם רוצים מסמנים את ה Send News every ב V ורושמים כל כמה זמן לפרסם את ההודעות ^^
הפעלה: על ידע הפקודה /News או אם סתם מישהו רושם בערוץ !news או פרסום אוטומטי מהדיאלוג.
תמונה:
הקוד:
קוד: בחר הכל
dialog news {
title "News Bot v1.1 by weeds"
size -1 -1 192 112
option dbu
list 1, 10 47 140 50, size
edit "", 2, 10 35 140 10, autohs
edit "", 6, 9 10 50 10, autohs
box "News channel", 7, 5 2 81 21
button "Set", 8, 61 9 21 10
text "", 9, 17 98 123 8, center
box "Add News", 10, 5 25 183 83
button "Add", 3, 152 34 33 12, default
button "Clear", 4, 152 71 33 12
button "Remove", 5, 152 48 33 12
check "Send News every:", 11, 94 11 52 8
text "minutes", 12, 163 11 21 8
box "Automatic News", 13, 91 2 97 21
edit "", 14, 148 10 14 10, disable autohs
button "Save | Exit", 15, 152 85 33 12
}
dialog newsinfo {
title "Info"
size -1 -1 198 40
option dbu
edit "", 1, 5 10 188 12, autohs
button "Update", 2, 80 23 35 12, ok
box "Update News", 3, 2 2 194 36
}
on *:Connect: { if (%News.timer == on) { .timerNEWS 0 $calc(%News.Timer.value * 60) /News } }
on *:dialog:*:*:*:{
if ($dname == news) {
if ($devent == init) {
unset %timer.change
did -a $dname 6 %news.channel
var %o = 1
while (%o <= $lines(News.txt)) {
did -a $dname 1 $read(News.txt, %o)
inc %o
}
if (%News.timer == on) { did -e $dname 14 | did -c $dname 11 }
elseif (%News.timer == off) { did -b $dname 14 }
did -a $dname 14 %News.Timer.value
/News.Lines
}
if ($devent == edit) {
if ($did == 14) {
if ($did(14).text !isnum) { did -ra $dname 14 $left($did(14).text,$calc($len($did(14).text)-1)) }
set %timer.change 1
}
}
if ($devent == close) { if (%timer.change == 1) {
set %News.Timer.value $did(14)
if (%News.timer == on) && ($did(14)) && ($did(14) != 0) { set %News.Timer on | .timerNEWS Off | .timerNEWS 0 $calc(%News.Timer.value * 60) /News | echo -a 14Automatic News is now 9ON14, Sending News every 10 $+ %News.Timer.value $+ 14minute $+ $iif(%News.Timer.value > 1,14s)) $+ 14 to 10 $+ %news.channel $+ 14. }
elseif (%News.timer == on) && (!$did(14)) { Set %News.timer off | .timerNEWS off | echo -a 4Automatic News 14is 04OFF 14- you need to specify the time. }
elseif (%News.timer == off) { set %news.timer off | .timerNEWS OFF }
/dialog -x news news
}
/dialog -x news news
}
if ($devent == sclick) {
if ($did == 3) && ($did(2)) {
var %x 1
:newsone
while (%x <= $lines(News.txt)) {
if ($read(News.txt,%x) == $did(2)) { halt }
else { inc %x | goto newsone }
}
did -a $dname 1 $did(2) | write News.txt $did(2) | /News.Lines | did -r $dname 2
}
if ($did == 8) && ($left($did(6),1) == $chr(35)) { set %news.channel $did(6) }
if ($did == 4) { .remove News.txt | did -r $dname 1 | /News.Lines }
if ($did == 11) { if ($did(11).state == 1) { set %News.timer on | did -e $dname 14 } | else { set %News.timer off | did -b $dname 14 } | set %timer.change 1 }
if ($did == 15) {
if (%timer.change == 1) {
set %News.Timer.value $did(14)
if (%News.timer == on) && ($did(14)) && ($did(14) != 0) { set %News.Timer on | .timerNEWS Off | .timerNEWS 0 $calc(%News.Timer.value * 60) /News | echo -a 14Automatic News is now 9ON14, Sending News every 10 $+ %News.Timer.value $+ 14minute $+ $iif(%News.Timer.value > 1,14s)) $+ 14 to 10 $+ %news.channel $+ 14. }
elseif (%News.timer == on) && (!$did(14)) { Set %News.timer off | .timerNEWS off | echo -a 4Automatic News 14is 04OFF 14- you need to specify the time. }
elseif (%News.timer == off) { set %news.timer off | .timerNEWS OFF }
/dialog -x news news
}
Else { /dialog -x news news }
}
if ($did == 5 && $did($dname,1).seltext) { var %z = $did($dname,1).sel | .write -dl $+ %z News.txt | did -d $dname 1 %z | /News.Lines }
}
if ($devent == dclick) {
if ($did == 1 && $did($dname,1).sel) { set %line $did($dname,1).sel | dialog $iif($dialog(Newsinfo),-v Newsinfo,-m Newsinfo Newsinfo) | did -r Newsinfo 1 | did -a newsinfo 1 $did($dname,1).seltext }
}
}
if ($dname == newsinfo) {
if ($devent == sclick) {
if ($did == 2 && * iswm $did(1)) { did -r news 1 | write -l $+ %line News.txt $did(1) | var %o = 1 | while (%o <= $lines(News.txt)) { did -a news 1 $read(News.txt, %o) | inc %o } }
}
}
}
alias News.Lines {
did -a $dname 9 There $iif($lines(News.txt) == 1,is,are) $iif($lines(News.txt) == 0,no,$lines(News.txt)) line $+ $iif($lines(News.txt) != 1,s) of news.
}
menu status,channel {
News Bot
.News Dialog { /dialog -m news news }
.Turn AutoNews $replacex(%News.timer,OFF,ON,ON,OFF) { if (%News.Timer == OFF) { set %News.Timer ON | .timerNEWS Off | .timerNEWS 0 $calc(%News.Timer.value * 60) /News | echo -a 14Automatic News is now 9ON14, Sending News every 10 $+ %News.Timer.value $+ 14minute $+ $iif(%News.Timer.value > 1,14s)) $+ 14 to 10 $+ %news.channel $+ 14. } | else { set %News.Timer OFF | .timerNEWS off | echo -a 14Automatic News is now 4OFF } }
}
on *:text:*:%news.channel:{ if ($1 == !News) { /News } }
alias News {
if (!%flood) {
if ($me isop %news.channel) { mode %news.channel +m
.timer 1 1 msg %news.channel 14Latest New $+ $iif($lines(News.txt) != 1,s) on 10 $+ %news.channel $+ 14 $+ $iif($lines(News.txt) == 1,is:,are:) $+
var %z = 1,%x = 2
while (%z <= $lines(News.txt)) { .timer 1 %x msg %news.channel 01 %mysymbol $+ $+ 10,00 $read(News.txt, %z) | inc %x | inc %z }
.timer 1 $calc(%x + 1) msg %news.channel 14End of news.
if ($me isop %news.channel) .timer 1 $calc(%x + 2) mode %news.channel -m
inc -u15 %flood
}
elseif ($me !isop %news.channel) {
msg %news.channel 14Latest New $+ $iif($lines(News.txt) != 1,s) on 10 $+ %news.channel $+ 14 $+ $iif($lines(News.txt) == 1,is:,are:) $+
var %z = 1,%x = 1
while (%z <= $lines(News.txt)) { .timer 1 %x msg %news.channel 01 %mysymbol $+ $+ 10,00 $read(News.txt, %z) | inc %x | inc %z }
.timer 1 %x msg %news.channel 14End of news.
if ($me isop %news.channel) .timer 1 $calc(%x + 1) mode %news.channel -m
inc -u15 %flood
}
}
}
עוד פעם אני אומר, אני נותן לכם עיצוב מסויים, ואתם תשנו בסקריפט איך שאתם רוצים
יש עד אינסוף עיצובים. אז זה העיצוב שאני אהבתי.
Enjoy
10/10/2010 ~ 10:33 : סודר באג בחלון האפדייט של החדשות.
נערך 10:33 10/10/10 - Version 1.1 - סודרו באגים בסקריפט. (10 10 10 10 10 יחנונים )