Advertisement
Guest User

Untitled

a guest
May 20th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.63 KB | None | 0 0
  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;
  3. ;; Services bot
  4. ;; By Arthas & Rizpaz
  5. ;;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7. ;;
  8. ;; To add admin, define Your botpass and type to the bot - YouRSIGN<Add> Admin <Botpass> <USER> <PASS>
  9. ;; Example: !Add Admin
  10. ;;
  11. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  12.  
  13.  
  14. ;;; Login system..
  15.  
  16. alias blacklist {
  17. var %b = 1
  18. while (%b <= $ulist(*,Blacklisted,0)) { var %bl = %bl $ulist(*,Blacklisted,%b) | inc %b }
  19. return $replace(%bl,$chr(32),$chr(32) $+ ? $+ $Chr(32))
  20. }
  21. alias vip {
  22. var %b = 1
  23. while (%b <= $ulist(*,vip,0)) { var %bl = %bl $ulist(*,vip,%b) | inc %b }
  24. return $replace(%bl,$chr(32),$chr(32) $+ ? $+ $Chr(32))
  25. }
  26. alias blackwords {
  27. var %ks 1
  28. while (%ks <= $numtok($1-,32)) {
  29. if ($istok(%blackwords,$gettok($1,%ks,32),32)) { return $gettok($1,%ks,32) | break }
  30. inc %ks
  31. }
  32. }
  33. on *:text:*:*:{
  34. if ($nick isreg #) && (# == %Channel) { if ($blackwords($1-)) { ban -k %Channel $nick 2 Blackwords protection $+ $chr(44) $chr(42) $+ $blackwords($1-) $+ $chr(42) } }
  35. if (!%flood) {
  36. if (%Cign $+ * iswm $1) {
  37. tokenize 32 $mid($1-,2) | var %n = Ctl $nick,%c = Ctl %Channel
  38. if ($target == %Channel) {
  39. if ($1 == status) {
  40. if (%C.status) { %c $LotteryON | %c $LotteryON2 | lflood }
  41. else { %c $LotteryOFF | lflood }
  42. }
  43. if ($1 == Prize) {
  44. if (%C.status) { %c The prize is %C.Prize | lflood }
  45. else { %c $LotteryOFF | lflood }
  46. }
  47. if ($1 == Admin) {
  48. if (%C.status) { %c The admin is %C.Admin | lflood }
  49. else { %c $LotteryOFF | lflood }
  50. }
  51. if ($1 == Regs) {
  52. if (%C.status) {
  53. if ($read(regs.txt)) { mode # + | totalusr | artregs }
  54. else { %c There are no registered users }
  55. lflood
  56. }
  57. else { %c $LotteryOFF | lflood }
  58. }
  59. if ($1 == Reg) {
  60. if (%C.status) {
  61. if ($checkreg($nick)) { %c $nick $+ $chr(44) You are already registered to the lottery. | lflood }
  62. else {
  63. if (%C.Blocktagstatus) {
  64. if (%C.Blocktag isin $nick) { %c $nick $+ $chr(44) You'r tag is blocked. | lflood }
  65. else { Nickregistered | lflood }
  66. }
  67. else { Nickregistered | lflood }
  68. }
  69. }
  70. else { %c $LotteryOFF | lflood }
  71. }
  72. if ($1 == Del) && (!$2) {
  73. if (%C.status) {
  74. if ($checkreg($nick)) { write -dl $+ $v1 regs.txt | %c $nick $+ $chr(44) You have successfully removed from the lottery. ( $+ $lines(regs.txt) $+ / $+ %C.MAX $+ %Color1 $+ ) | lflood }
  75. else { %c $nick $+ $chr(44) You're not registered to the lottery. | lflood }
  76. }
  77. else { %c $LotteryOFF | lflood }
  78. }
  79. }
  80. if ($target == %Channel) || ($target !ischan) {
  81. %e = Ctl $iif($target ischan,%Channel,$nick)
  82. if ($1 == Admins) { %e $Admins | inc -u5 %flood }
  83. if ($Admins($right($wildsite,-4)).logged) {
  84. if ($1 == chanlev) && ($2) {
  85. if ($(% $+ d $+ $nick,2) == 5) { Ctl $nick You are ignored $+ $chr(44) Contraceptives to takeover. | ignore $wildsite }
  86. else {
  87. .msg q chanlev $2-
  88. inc -u4 %flood | set -u4 %floodnick $nick | inc -u25 %d $+ $nick
  89. }
  90. }
  91. ;if ($1 == Credits) { %e This services bot has been created by Sibonis $+ $chr(44) v1 | inc -u5 %flood }
  92. if (mode == $1) && ($2) { mode %Channel $2- | %e mode $2- | lflood }
  93. if ($istok(kick ban kban,$1,32)) && ($2) {
  94. var %b
  95. if ($3) {
  96. if ($3 == adv) %b = Advertise on join
  97. if ($3 == kalb) %b = check
  98. else %b = $3-
  99. }
  100. else {
  101. %b = Without any reason
  102. }
  103. $iif(ban isin $1,ban %Channel $address($2,2))
  104. $iif(k isin $1,kick %Channel $2 Kicked by $nick $+ $chr(44) %b )
  105. lflood
  106. }
  107. if ($1 == Blacklist) { if ($ulist(*,Blacklisted,0) !== 0) { %e Blacklist users: | %e $blacklist } | else %e There are no BLACKLIST users. | lflood }
  108. if ($1 == Blackwords) { if ($numtok(%blackwords,32) > 0) { %e Blackwords: | %e $replace(%blackwords,$chr(32),$chr(32) $+ ? $+ $Chr(32)) } | else %e There are no BLACKLIST users. | lflood }
  109. if ($1 == add) {
  110. if ($2 == blackword) && ($3) && ($3 !isin %blackwords) { set %blackwords $addtok(%blackwords,$3-,32) | %e the word $+ $iif($4,s) $3- $iif($4,have,has) been added to the blackwords list. | lflood }
  111. if ($2 == vip) && (*@* iswm $3) && ($istok(v +v o +o,$4,32)) { .auser vip $3- | %e Done $+ $chr(44) $3 has been added to the vip list with the mode $4. | lflood }
  112. if ($2 == black) && (*@* iswm $3) { .auser Blacklisted $3- | %e Done $+ $chr(44) $3 has been added to the blacklist. | lflood }
  113. }
  114. if ($1 == del) && ($3) {
  115. if ($2 == blackword) && ($3) && ($3 isin %blackwords) { %e The word $+ $iif($4,s) $matchtok(%blackwords,$3-,1,32) $iif($4,have,has) been deleted from the blackwords list. | set %blackwords $remtok(%blackwords,$matchtok(%blackwords,$3-,1,32),1,32) | lflood }
  116. if ($2 == vip) {
  117. if ($3 isin $vip) {
  118. %e Done $+ $chr(44) $matchtok($vip,$3,1,32) has been deleted from the VIP list. | .ruser $matchtok($vip,$3,1,32) | lflood
  119. }
  120. }
  121. if ($2 == black) {
  122. if ($3 isin $blacklist) {
  123. %e Done $+ $chr(44) $matchtok($blacklist,$3,1,32) has been deleted from the blacklist. | .ruser $matchtok($blacklist,$3,1,32) | lflood
  124. }
  125. }
  126. }
  127. if ($1 == Banclear) { mode %Channel -b * | lflood }
  128. if ($1 == VIP) { if ($ulist(*,vip,0) !== 0) { %e VIP users: | %e $vip } | else %e There are no VIP users. | lflood }
  129. if ($istok(+mr -mr +r -r +s -s +m -m,$1,32)) { mode %Channel $1- | %e mode $1- | lflood }
  130. if ($istok(i invite,$1,32)) && ($2) {
  131. if ($2 ison %Channel) { %e Invite faild $+ $chr(44) $2 is already on %Channel | lflood }
  132. else { invite $2 %Channel | Ctl $2 You have been invited to %Channel $+ $Chr(44) Gathers and free busted servers & vents ! JOIN | %e $2 was invited in successfully. | lflood }
  133. }
  134. if ($istok(n notice,$1,32)) {
  135. if ($2) {
  136. mode %Channel -N | nCtl # $2- | mode %Channel +N | lflood
  137. }
  138. elseif (%C.status) {
  139. mode %Channel -N | nCtl # $LotteryON | nCtl # $LotteryON2 | mode %Channel +N | lflood
  140. }
  141. }
  142. if ($1 == Commands) { nCtl $nick $cmd(SetChannel) $cmd(Mahur) <ON/OFF> $cmd(Mahur) <WinnerNick> $cmd(Start) $cmd(Stop) $cmd(NewWinner) $cmd(SetPrize) $cmd(SetMax) $cmd(Blocktag <ON/OFF>) $cmd(Blocktag <TAG>) $cmd(SetAdmin) $cmd(SetSign) $cmd(Join <#CHAN>) $cmd(Part <CHAN>) $cmd(Del) <Nick> | lflood }
  143. if ($1 == setprize) && ($2) { set %C.Prize $2- | %e Done $+ $chr(44) lottery prize changed to $2- | lflood }
  144. if ($1 == setmax) && ($2) { set %C.MAX $2 | %e Done $+ $chr(44) lottery max users changed to $2 | lflood }
  145. if ($1 == setchannel) && ($2) { sec %Channel $2 | %e Done $+ $chr(44) channel changed to $2 | lflood }
  146. if ($1 == Blocktag) {
  147. if ($2 == ON) { inc %C.blocktagstatus | %e Done $+ $chr(44) block tag turned to ON | lflood }
  148. elseif ($2 == OFF) { unset %C.blocktagstatus | %e Done $+ $chr(44) block tag turned to OFF | lflood }
  149. elseif ($2) { set %C.Blocktag $2 | %e Done $+ $chr(44) $chr(42) $+ $2 $+ $chr(42) tag is now blocked $+ $chr(44) Blocktag status is $iif(%C.blocktagstatus,ON,OFF) | lflood }
  150. else { %e The Blocktag Status is $iif(%C.blocktagstatus,ON,OFF) | lflood }
  151. }
  152. if ($1 == Mahur) {
  153. if ($2 == ON) { inc %C.Mahur | %e Done $+ $chr(44) lottery mahur is now ON. }
  154. elseif ($2 == OFF) { unset %C.Mahur | %e Done $+ $chr(44) lottery mahur is now OFF. }
  155. elseif ($2) { set %C.MahurWin $2 | %e Done $+ $chr(44) the winner of the lottery will be %C.MahurWin $+ $iif(!%C.Mahur,$chr(44) Mahur status is OFF) }
  156. else { %e The Mahur Status is $iif(%C.Mahur,ON,OFF) | lflood }
  157. lflood
  158. }
  159. If ($1 == NewWinner) {
  160. if (%C.NewWinnerCan) { LotteryNewWinner }
  161. else { %e Lottery new winner time has left }
  162. lflood
  163. }
  164. if ($1 == join) && ($2) { join $2 | %e Joining to $2 | lflood }
  165. if ($1 == nick) && ($2) { nick $2 | %e Changing nick to $2 | lflood }
  166. if ($istok(say msg text,$1,32)) && ($3) { msg $2- | lflood }
  167. if ($1 == del) && ($2) && (!$3) {
  168. if (%C.status) {
  169. if ($checkreg($2)) { write -dl $+ $v1 regs.txt | %e $2 was removed in success. ( $+ $lines(regs.txt) $+ / $+ %C.MAX $+ %Color1 $+ ) | lflood }
  170. else { %e $2 does'nt register to the lottery | lflood }
  171. }
  172. else { %c $LotteryOFF | lflood }
  173. }
  174. if ($1 == part) && ($2) { part $2 | %e Parting from $2 | lflood }
  175. if ($1 == Start) { if (%C.Status) %e Lottery is already running $+ $chr(44) to stop this lottery type $cmd(Stop) | else %e Check all the details about the lottery $+ $chr(44) if they are ok type $cmd(StartSure) $+ . | set -u15 %C.STARTSURE ON | lflood }
  176. if ($1 == Stop) { if (%C.Status) %e If You are sure that You want to stop the lottery type $cmd(StopSure) $+ . | else %e $LotteryOFF | lflood }
  177. if ($1 == StartSure) && (!%C.Status) { LotterySTART | %e Lottery is NOW starting at %Channel $+ $chr(44) Max users: %C.MAX Prize: %C.Prize blocktag: $iif(%C.blocktagstatus,ON,OFF) $iif(%C.blocktagstatus,- %C.Blocktag) }
  178. if ($1 == StopSure) && (%C.Status) { LotteryStop | %e Lottery stopped. }
  179. }
  180. }
  181. if ($target !ischan) {
  182. if ($1 == Login) && ($Admins($2 $3).login) && (!$Admins($right($wildsite,-4)).logged) { writeini Admins.ini $2 Logged $right($wildsite,-4) | %c $nick has been connected to admin account. User: $Admins($right($wildsite,-4)).user ( $+ $wildsite $+ ) | %n You have been connected to admin account. User: $Admins($right($wildsite,-4)).user ( $+ $wildsite $+ ) | inc -u5 %flood }
  183. elseif ($1 == Logout) && ($Admins($right($wildsite,-4)).logged) { %c $nick has been disconnected from admin account. User: $Admins($right($wildsite,-4)).user $+ $Chr(44) Reason: Logout ( $+ $wildsite $+ ) | %n You have been connected to admin account. User: $Admins($right($wildsite,-4)).user $+ $Chr(44) ( $+ $wildsite $+ ) | remini Admins.ini $Admins($right($wildsite,-4)).user Logged | inc -u5 %flood }
  184. elseif ($1 == Add && $5) {
  185. if ($2 == Admin) {
  186. if ($3 == %botpass) {
  187. if ($Admins($4).isin) { %n Error: the username $4 is already in use $+ $chr(44) please try another user name. }
  188. else { writeini Admins.ini $4 Pass $5 | %n Admin successfully added $+ $chr(44) for login /msg $me %Cign $+ login $4 $5 }
  189. }
  190. else { %n Error: the bot pass is wrong ! }
  191. }
  192. inc -u5 %flood
  193. }
  194. elseif ($1 == Del && $4) {
  195. if ($2 == Admin) {
  196. if ($3 == %botpass) {
  197. if ($Admins($4).isin) { remini Admins.ini $4 | %n Admin successfully removed $+ $chr(44) user: $4 }
  198. else { %n Error: the username $4 is not on the admins list. }
  199. }
  200. else { %n Error: the bot pass is wrong ! }
  201. }
  202. inc -u5 %flood
  203. }
  204. elseif ($1 == Change && $5) {
  205. if ($2 == Botpass) {
  206. if ($3 == %botpass) {
  207. if ($4 == $5) { %n The bot pass is successfully changed from %botpass to $4 | set %botpass $4 }
  208. else { %n Error: Wrong syntax. !Change botpass <botpass> <newbotpass> <newbotpass> }
  209. }
  210. else { %n Error: the bot pass is wrong ! }
  211. }
  212. inc -u5 %flood
  213. }
  214. }
  215. }
  216. if ($lines(regs.txt) == %C.MAX) { LotteryEND }
  217. }
  218. }
  219. on !@*:join:%Channel: {
  220. if ($level($ulist($nick $+ $address($nick,2))) == Blacklisted) && ($nick !== wowbot) && ($nick !== triviabot) { ban -k %Channel $nick 2 You are in my BLACKLIST. $iif($ulist($maddress).info,Reason: $ulist($maddress).info) }
  221. elseif ($level($ulist($nick $+ $address($nick,2))) == VIP) && ($nick !== wowbot) && ($nick !== triviabot) { Ctl # VIP Detected | .timer 1 1 Ctl # Nick: $nick $+ $chr(44) Address: $maddress $+ $Chr(44) Mode: $ulist($maddress).info | .timer 1 2 mode # + $+ $ulist($maddress).info $nick }
  222. }
  223. alias Admins {
  224. if ($1) {
  225. if ($prop == user) { var %x = 1 | while (%x <= $ini(Admins.ini,0)) { if ($1 == $readini(Admins.ini,$ini(Admins.ini,%x),Logged)) return $ini(Admins.ini,%x) | inc %x } }
  226. if ($prop == login) && ($readini(Admins.ini,$gettok($1,1,32),Pass) == $gettok($1,2,32)) { return $true }
  227. if ($prop == isin) { var %x = 1 | while (%x <= $ini(Admins.ini,0)) { if ($1 == $ini(Admins.ini,%x)) { return $true | break } | inc %x } }
  228. if ($prop == logged) { var %x = 1 | while (%x <= $ini(Admins.ini,0)) { if ($1 == $readini(Admins.ini,$ini(Admins.ini,%x),Logged)) { return $true | break } | inc %x } }
  229. }
  230. if (!$prop) { var %x = 1, %y = 0 | while (%x <= $ini(Admins.ini,0)) { var %admins = %admins $iif($readini(Admins.ini,$ini(Admins.ini,%x),Logged),3,4) $+ $ini(Admins.ini,%x) | if ($readini(Admins.ini,$ini(Admins.ini,%x),Logged)) inc %y | inc %x } | return Admins are ( $+ $iif(%y == 0,14,03) $+ %y $+ %Color1 $+ / $+ $ini(Admins.ini,0) $+ ) $replacE(%admins,$chr(32),$+(%Color1,$chr(44),$chr(32))) }
  231. }
  232. menu * {
  233. Bot
  234. .Set Channel: var %p = $?=\"Type channel" | $iif($chr(35) isin %p,set %Channel %p,echo -a Error: Type the channel with "#")
  235. .Set Sign: var %p = $?=\"Type sign" | $iif(%p,set %Cign %p,echo -a Error: Type sign)
  236. .Set Botpass: var %p = $?=\"Type botpass" | $iif(%p,set %Botpass %p,echo -a Error: Type botpass)
  237. .Clear Admins: .remove Admins.ini
  238. .Open admins file: $iif($exists(Admins.ini),run Admins.ini,echo -a There is no admins.)
  239. .Styles dialog: dialog -m styless styless
  240. }
  241. on ^*:notice:*:?:{
  242. if ($nick == Q) {
  243. haltdef
  244. if (%floodnick) {
  245. if (%floodis <= 4) || (!%floodis) {
  246. Ctl %floodnick $1- | inc -u4 %floodis
  247. }
  248. }
  249. }
  250. }
  251. on *:part:%Channel: {
  252. if ($Admins($right($wildsite,-4)).logged) { Ctl $nick You have been disconnected from admin account. User: $Admins($right($wildsite,-4)).user $+ $Chr(44) Reason: Part ( $+ $wildsite $+ ) | Ctl # $nick has been disconnected from admin account. User: $Admins($right($wildsite,-4)).user $+ $Chr(44) Reason: Part ( $+ $wildsite $+ ) | remini Admins.ini $Admins($right($wildsite,-4)).user Logged }
  253. if ($checkreg($nick)) { write -dl $+ $v1 regs.txt | .timer 1 1 totalusr }
  254. }
  255. on *:quit: {
  256. if ($Admins($right($wildsite,-4)).logged) { Ctl %Channel $nick has been disconnected from admin account. User: $Admins($right($wildsite,-4)).user $+ $Chr(44) Reason: Quit ( $+ $wildsite $+ ) | remini Admins.ini $Admins($right($wildsite,-4)).user Logged }
  257. if ($checkreg($nick)) { write -dl $+ $v1 regs.txt | .timer 1 1 totalusr }
  258. }
  259. on *:kick:%Channel: {
  260. if ($Admins($right($address($knick,2),-4)).logged) { Ctl # $knick has been disconnected from admin account. User: $Admins($right($address($knick,2),-4)).user $+ $Chr(44) Reason: Kick ( $+ $address($knick,2) $+ ) | Ctl $knick You have been disconnected from admin account. User: $Admins($right($address($knick,2),-4)).user $+ $Chr(44) Reason: Kick ( $+ $address($knick,2) $+ ) | remini Admins.ini $Admins($right($address($knick,2),-4)).user Logged }
  261. if ($checkreg($knick)) { write -dl $+ $v1 regs.txt | .timer 1 1 totalusr }
  262. }
  263. on *:nick: {
  264. if ($nick == %C.Admin) { set %C.admin $newnick }
  265. if ($checkreg($nick)) { write -l $+ $v1 regs.txt $newnick }
  266. }
  267.  
  268. ;; dialogs
  269.  
  270. on *:dialog:artlot*:*:*:{
  271. if ($devent == init) {
  272. if (sty isin $dname) && (%dstyle) { did -c $dname %dstyle | halt }
  273. did -a $DName 25 %Channel
  274. did -a $DName 26 %C.prize
  275. did -a $DName 27 %C.MAX
  276. did -a $DName 28 %Cign
  277. did -a $DName 29 %C.admin
  278. did -a $DName 30 %C.tag
  279. did -a $DName 20 %C.blocktag
  280. did -a $DName 35 %C.MahurWin
  281. if (%C.Mahur) { did -c $DName 34 }
  282. else { did -b $DName 35 }
  283. if (%C.Blocktagstatus) { did -c $DName 21 }
  284. else { did -c $DName 23 | did -b $DName 20 }
  285. var %o = 1
  286. }
  287. if ($devent == sclick) {
  288. if (sty isin $dname) && ($did isnum 1-15) && ($did($did).state) { set %dstyle $did | setstyle $did | halt }
  289. If ($Did == 21) && ($did(21).state) { inc %C.Blocktagstatus | did -e $DName 20 }
  290. If ($Did == 23) && ($did(23).state) { unset %C.Blocktagstatus | did -b $DName 20 }
  291. If ($Did == 34) {
  292. if ($did(34).state) { inc %C.Mahur | did -e $DName 35 }
  293. else { unset %C.Mahur | did -b $DName 35 }
  294. }
  295. If ($Did == 31) {
  296. if (#* iswm $did(25)) { set %Channel $did(25) }
  297. if ($did(26)) { set %C.prize $did(26) }
  298. if ($did(27)) { set %C.MAX $did(27) }
  299. if ($did(28)) { set %Cign $did(28) }
  300. if ($did(29)) { set %C.Admin $did(29) }
  301. if ($did(30)) { set %C.tag $did(30) }
  302. if ($did(20)) { set %C.blocktag $did(20) }
  303. if ($did(35)) { set %C.MahurWin $did(35) }
  304. }
  305. If ($Did == 32) { dialog $iif($dialog(artlot.style),-v artlot.style,-m artlot.style artlot.style) }
  306. If ($Did == 4) {
  307. if (%C.status) { Ctle Lottery is already running. }
  308. else { LotterySTART }
  309. }
  310. If ($Did == 5) {
  311. if (%C.status) { LotterySTOP }
  312. else { Ctle Lottery is not running. }
  313. }
  314. If ($Did == 6) {
  315. if (%C.NewWinnerCan) { LotteryNewWinner }
  316. else { Ctle Lottery new winner time has left }
  317. }
  318. }
  319. }
  320.  
  321. dialog artlot.style {
  322. title "Styles"
  323. size -1 -1 58 72
  324. option dbu notheme
  325. radio "1", 1, 7 16 15 10, push
  326. text "Styles", 22, 0 5 58 8, center
  327. radio "2", 2, 22 16 15 10, push
  328. radio "3", 3, 37 16 15 10, push
  329. radio "4", 4, 7 26 15 10, push
  330. radio "5", 5, 22 26 15 10, push
  331. radio "6", 6, 37 26 15 10, push
  332. radio "7", 7, 7 36 15 10, push
  333. radio "8", 8, 22 36 15 10, push
  334. radio "9", 9, 37 36 15 10, push
  335. radio "10", 10, 7 46 15 10, push
  336. radio "11", 11, 22 46 15 10, push
  337. radio "12", 12, 37 46 15 10, left push
  338. radio "13", 13, 7 56 15 10, left push
  339. radio "14", 14, 22 56 15 10, left push
  340. radio "15", 15, 37 56 15 10, left push
  341. }
  342.  
  343. dialog artlot {
  344. title "Lottery bot"
  345. size -1 -1 220 266
  346. option pixels notheme
  347. tab "Settings", 1, 4 1 215 267
  348. text "Channel:", 15, 18 49 44 16, tab 1
  349. text "Prize:", 16, 18 80 28 16, tab 1
  350. text "MAXUsers:", 17, 19 112 54 16, tab 1
  351. text "Admin:", 18, 18 145 34 16, tab 1
  352. text "Channel Tag:", 19, 16 178 64 16, tab 1
  353. radio "ON", 21, 66 208 36 12, tab 1
  354. text "Blocktag:", 22, 16 212 46 16, tab 1
  355. radio "OFF", 23, 66 221 38 12, tab 1
  356. edit "", 20, 109 208 28 23, tab 1 autohs
  357. text "Sign:", 24, 128 112 24 16, tab 1
  358. edit "", 25, 64 47 70 21, tab 1 autohs
  359. edit "", 27, 81 109 38 21, tab 1
  360. edit "", 28, 158 109 16 21, tab 1 autohs
  361. edit "", 29, 55 141 80 21, tab 1 autohs
  362. edit "", 30, 84 173 52 21, tab 1 autohs
  363. button "Update ALL", 31, 21 235 75 25, tab 1
  364. edit "", 26, 49 79 86 21, tab 1 autohs
  365. button "Open Styles dialog", 32, 100 235 101 25, tab 1
  366. edit "", 35, 142 80 68 21, tab 1 autohs
  367. text "Type winner", 36, 143 64 60 12, tab 1
  368. check "Mahur", 34, 144 46 56 16, tab 1
  369. tab "Start/Stop", 3
  370. button "New Winner", 6, 66 193 75 25, tab 3
  371. button "Start", 4, 66 51 75 25, tab 3
  372. button "Stop", 5, 64 121 75 25, tab 3
  373. text "Only if lottery is running", 7, 45 175 118 16, disable tab 3 center
  374. text "Only on the 500 seconds after finish the lottery", 33, 22 151 160 26, disable tab 3 center
  375. }
  376.  
  377. ;; aliases
  378.  
  379. alias lflood inc -u3 %flood
  380. alias Nickregistered write regs.txt $nick | Ctl # $nick $+ $chr(44) You have successfully registered to the lottery. ( $+ $lines(regs.txt) $+ / $+ %C.MAX $+ %Color1 $+ )
  381. alias LotteryON return Lottery is ON $+ $chr(44) the prize is %C.prize $+ ! There are $lines(regs.txt) registered users out of %C.MAX $+ .
  382. alias LotteryON2 return To enter the lottery use $cmd(Reg) $+ .
  383. alias LotteryOFF return Lottery is not running right now $+ $chr(44) last lottery was started at %C.Time $+ , %C.Date $+ .
  384. alias cmd if ($1) return %Color2 $+ %Cign $+ %Color1 $+ $1
  385. alias nCtl notice $1 %Ctyle1 %Color1 $+ 1 $+ $2- %Ctyle2
  386. alias totalusr if (!%flood) { Ctl # Total registered users: $lines(regs.txt) $+ / $+ %C.MAX | inc -u3 %flood }
  387. alias Ctl .msg $1 %Ctyle1 %Color1 $+ $2- %Ctyle2
  388. alias Ctle echo -a %Ctyle1 %Color1 $+ $1- %Ctyle2
  389. alias setWinner set -u3 %C.Winner $read(regs.txt)
  390. alias NewWinnerSet set -u20 %C.NewWinner $read(regs.txt)
  391. alias NewSetWinner {
  392. set -u400 %C.NewRegs %C.Regs
  393. set -u400 %C.NewMAX %C.MAX
  394. inc -u400 %C.NewWinnerCan
  395. }
  396. alias checkreg {
  397. if ($1) {
  398. var %x 1
  399. while (%x <= $lines(regs.txt)) {
  400. if ($1 == $read(regs.txt,%x)) { return %x | break }
  401. inc %x
  402. }
  403. }
  404. }
  405. alias artregs {
  406. unset %timer
  407. var %x 1,%k 1,%t
  408. while (%x <= $lines(regs.txt)) {
  409. var %t %t $read(regs.txt,%x) | inc %x | inc %k
  410. if (%k == 15) { inc %timer | .timer 1 $calc(%timer *5) Ctl # $replace(%t,$chr(32),$+($chr(44),$chr(32))) | var %k $null,%t $null }
  411. }
  412. if ($calc($lines(regs.txt) - %x) < 15) { inc %timer | .timer 1 $calc(%timer *5) Ctl # $replace(%t,$chr(32),$+($chr(44),$chr(32))) }
  413. inc $(-u $+ $calc(%timer *5 +5)) %flood
  414. .timer 1 $calc(%timer *5 +5) mode # -m
  415. unset %timer
  416. }
  417. alias SetStyle {
  418. goto $1
  419. :1 | Set %Ctyle1 8,1[15? | Set %Ctyle2 15,1?8,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  420. :2 | Set %Ctyle1 12,1[15? | Set %Ctyle2 15,1?12,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  421. :3 | Set %Ctyle1 9,1[15? | Set %Ctyle2 15,1?9,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  422. :4 | Set %Ctyle1 10,1[15? | Set %Ctyle2 15,1?10,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  423. :5 | Set %Ctyle1 4,1[15? | Set %Ctyle2 15,1?4,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  424. :6 | Set %Ctyle1 7,1[15? | Set %Ctyle2 15,1?7,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  425. :7 | Set %Ctyle1  | Set %Ctyle2  | Set %Color1  | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  426. :8 | Set %Ctyle1 12,1[8? | Set %Ctyle2 8,1?12,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  427. :9 | Set %Ctyle1 8,1[4? | Set %Ctyle2 4,1?8,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  428. :10 | Set %Ctyle1 14,1[07? | Set %Ctyle2 7,1?14,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  429. :11 | Set %Ctyle1 14,1[10? | Set %Ctyle2 10,1?14,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  430. :12 | Set %Ctyle1 14,1[4? | Set %Ctyle2 4,1?14,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  431. :13 | Set %Ctyle1 14,1[6? | Set %Ctyle2 6,1?14,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  432. :14 | Set %Ctyle1 14,1[3? | Set %Ctyle2 3,1?14,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  433. :15 | Set %Ctyle1 14,1[9? | Set %Ctyle2 9,1?14,1] | Set %Color1 0,1 | Ctle - $+ $1 $+ - Bot: $+ %Color1 by Arthas | halt
  434. }
  435. alias LotteryNewWinner {
  436. NewWinnerSet
  437. mode %Channel +m
  438. timer 1 1 Ctl %Channel The new winner is now being randomly selected please wait...
  439. timer 1 7 Ctl %Channel The winner has been chosen.
  440. timer 1 8 Ctl %Channel And the new winner is...
  441. timer 1 12 Ctl %Channel The new winner is %C.NewWinner $+ .
  442. timer 1 13 Ctl %Channel You won a %C.Prize $+ .
  443. timer 1 14 Ctl %Channel The lottery ended.
  444. timer 1 14 Ctl %C.NewWinner You won at %Channel 's lottery $+ $chr(44) in the next minutes the admin of the lottery will contact You and You will get Your prize. ( $+ %C.prize $+ )
  445. unset %c.status
  446. timer 1 15 mode %Channel -m
  447. }
  448. alias LotteryEND {
  449. NewSetWinner
  450. setWinner
  451. var %win $iif(%C.Mahur,%C.MahurWin,%C.Winner)
  452. mode %Channel +m
  453. timer 1 1 Ctl %Channel The winner is now being randomly selected please wait...
  454. timer 1 7 Ctl %Channel The winner has been chosen.
  455. timer 1 8 Ctl %Channel And the winner is...
  456. timer 1 12 Ctl %Channel The winner is %win $+ .
  457. timer 1 13 Ctl %Channel You won a %C.Prize $+ .
  458. timer 1 14 Ctl %Channel The lottery ended.
  459. timer 1 14 Ctl %win You won at %Channel 's lottery $+ $chr(44) in the next minutes the admin of the lottery will contact You and You will get Your prize. ( $+ %C.prize $+ )
  460. unset %C.status
  461. remove regs.txt
  462. unset %C.Winner
  463. unset %C.MahurWin
  464. timer 1 15 mode %Channel -m
  465. }
  466. alias LotterySTART {
  467. timers off
  468. inc %C.status
  469. inc %C.number
  470. set %C.Time $time
  471. set %C.Date $date
  472. mode %Channel +m
  473. timer 1 1 Ctl %Channel Starting the lottery number %Color2 $+ %C.number $+ %Color1 $+ .
  474. timer 1 2 Ctl %Channel Max users: %Color2 $+ %C.Max $+ %Color1 $+ $chr(44) Prize: %Color2 $+ %C.Prize $+ %Color1 $+ .
  475. timer 1 3 Ctl %Channel Commands are $cmd(Reg) $+ $chr(44) $cmd(Del) & $cmd(Regs) $+ .
  476. timer 1 14 mode %Channel -m
  477. }
  478. alias LotterySTOP {
  479. unset %C.status
  480. remove regs.txt
  481. unset %C.Winner
  482. Ctl %Channel Lottery number %Color2 $+ %C.number $+ %Color1 stopped $+ $iif($nick !== $me,$chr(32) $+ by $nick) $+ .
  483. }
  484.  
  485. ;; menu
  486.  
  487. menu * {
  488. Lottery dialog: dialog -m artlot artlot
  489. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement