Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ::::Alias's::::
- #Dices on
- alias roll {
- var %die.amount $readini(dice.ini,dicectrl,die.amount), %die.side $readini(dice.ini,dicectrl,die.side)
- if (%die == $null) { set %die 0 }
- set -u20 %dice.trigger $calc(%dice.trigger + 1)
- if (%dice.trigger >= 5) { unset %dice.trigger | disable #Dices | timer5 1 5 enable #Dices }
- var %i = 0, %limit = $iif(%die < %die.amount,%die,%die.amount)) | :cont | while %i < %limit { inc %i | set -u2 %dice $addtok($rand(1,$iif(%side < %die.side,%side,%die.side)),%dice,32)) }
- if (%die == 1) { %msg.chan %msg.user %dice.nick : You have rolled the following: $remove($calc(%dice + %stat),$chr(43)) $iif(%stat,$chr(124) Roll without stat %dice,$null)) S~:Tahoma; $+ %diecolor $+ %diestyle | goto next }
- if (%die == 0) { raw -q privmsg %msg.chan %dice.nick : Please specify a number of dice(s) and dice side(s) when using the command! S~:Tahoma; $+ %diecolor $+ %diestyle | return }
- %msg.chan %msg.user %dice.nick : You have rolled the following: %dice S~:Tahoma; $+ %diecolor $+ %diestyle
- set -u2 %dice.count $replace($gettok(%dice,1-100,32),$chr(32),$chr(43))) $+ %stat | %msg.chan %msg.user %dice.nick : For a Total Roll of: $calc(%dice.count) $iif(%stat,$chr(124) Roll without stat $calc(%dice.count - %stat),$null)) S~:Tahoma; $+ %diecolor $+ %diestyle
- :next
- $iif(%msg.chan,$null,echo $gettok(%msg.user,4,32) 12 %dice.nick %dicemsgcolor You have rolled the following: %dice))
- $iif(%msg.chan,$null,echo $gettok(%msg.user,4,32) %dicemsgcolor For a Total Roll of: $calc(%dice.count)) $iif(%stat,$chr(124) Roll without stat $calc(%dice.count - %stat),$null))
- }
- #Dices end
- alias msgcolor {
- var %msgclr $readini(dice.ini,dicectrl,msgclr)
- if (%msgclr == black) { set %diecolor #000000; }
- if (%msgclr == dark grey) { set %diecolor #333333; }
- if (%msgclr == lighter grey) { set %diecolor #666666; }
- if (%msgclr == light grey) { set %diecolor #999999; }
- if (%msgclr == lightest grey) { set %diecolor #CCCCCC; }
- if (%msgclr == Red) { set %diecolor #FF0000; }
- if (%msgclr == bright green) { set %diecolor #00FF00; }
- if (%msgclr == Blue) { set %diecolor #0000FF; }
- if (%msgclr == bright yellow) { set %diecolor #FFFF00; }
- if (%msgclr == light blue) { set %diecolor #00FFFF; }
- if (%msgclr == pink) { set %diecolor #FF00FF; }
- if (%msgclr == dark blue) { set %diecolor #000066; }
- if (%msgclr == Brown) { set %diecolor #990000; }
- if (%msgclr == Purple) { set %diecolor #9900CC; }
- if (%msgclr == dark green) { set %diecolor #006633; }
- }
- alias clr.sel {
- var %msgclr $readini(dice.ini,dicectrl,msgclr)
- if (%msgclr == black) { did -c DiceControls 11 1 }
- if (%msgclr == dark grey) { did -c DiceControls 11 2 }
- if (%msgclr == lighter grey) { did -c DiceControls 11 3 }
- if (%msgclr == light grey) { did -c DiceControls 11 4 }
- if (%msgclr == lightest grey) { did -c DiceControls 11 5 }
- if (%msgclr == Red) { did -c DiceControls 11 6 }
- if (%msgclr == bright green) { did -c DiceControls 11 7 }
- if (%msgclr == Blue) { did -c DiceControls 11 8 }
- if (%msgclr == bright yellow) { did -c DiceControls 11 9 }
- if (%msgclr == light blue) { did -c DiceControls 11 10 }
- if (%msgclr == pink) { did -c DiceControls 11 11 }
- if (%msgclr == dark blue) { did -c DiceControls 11 12 }
- if (%msgclr == Brown) { did -c DiceControls 11 13 }
- if (%msgclr == Purple) { did -c DiceControls 11 14 }
- if (%msgclr == dark green) { did -c DiceControls 11 15 }
- }
- alias style.sel {
- if (%msgstyle == Normal) { set %diestyle 1; | did -c DiceControls 12 1 }
- if (%msgstyle == Bold) { set %diestyle 2; | did -c DiceControls 12 2 }
- if (%msgstyle == Italic) { set %diestyle 3; | did -c DiceControls 12 3 }
- if (%msgstyle == Underline) { set %diestyle 5; | did -c DiceControls 12 4 }
- }
- alias chan.list {
- if ($dialog(DiceControls)) { did -r DiceControls 19 }
- var %a $readini(dice.ini,dicectrl,chan.count), %b = 0 | set -u60 %channels $readini(dice.ini,dicectrl,channels) | set -u60 %roll.channels $chr(37) $+ $chr(35) $+ $replace($readini(dice.ini,dicectrl,channels),$chr(32),$chr(44) $chr(37) $+ $chr(35)))
- while (%b < %a) {
- inc %b
- if ($dialog(DiceControls)) { did -a DiceControls 19 $chr(37) $+ $chr(35) $+ $gettok(%channels,%b,32))) }
- }
- }
- alias oa_fnt { return $regsubex($1-,/S~:.*$/gi,$null) }
- alias var_cb {
- set -u5 %die.amount $readini(dice.ini,dicectrl,die.amount)) | set -u5 %die.side $readini(dice.ini,dicectrl,die.side)) | set -u5 %chan.count $readini(dice.ini,dicectrl,chan.count))
- if (%die.amount == 0) { echo -a 4 Please add the number of die you want to use. | dialog -dm DiceControls DiceControls }
- if (%die.side == 0) { echo -a 4 Please add the number of die sides you want to use. }
- if (%chan.count == 0) { echo -a 4 Please add a channel for the script to post in the $chr(40) $+ chan control $+ $chr(41) tab. }
- }
- ::::Dialog's::::
- dialog DiceControls {
- title "Settings"
- size -1 -1 142 114
- option dbu
- tab Dice settings, 17, 0 -2 143 105
- tab Chan control, 18
- text "Message options" 1, 55 12 50 10, tab 17
- text "Die Amount" 3, 10 32 50 10, tab 17
- text "Die Sides" 4, 102 32 38 10, tab 17
- Button "chatroom" 5, 48 20 27 10, tab 17
- Button "user" 6, 76 20 27 10, tab 17
- Combo 9, 2 40 50 40, size drop, tab 17
- Combo 10, 90 40 50 40, size drop, tab 17
- Combo 11, 2 65 50 40, size drop, tab 17
- Combo 12, 90 65 50 40, size drop, tab 17
- text "Text Color" 13, 10 57 50 8, tab 17
- text "Text Style" 14, 102 57 38 8, tab 17
- Button "Clr dice amount" 15, 5 85 41 10, tab 17
- Button "Clr dice Sides" 16, 92 85 41 10, tab 17
- edit "" 23, 4 103 134 10, tab 17
- list 19, 0 13 100 126, tab 18
- button "Add channel" 20, 102 13 39 10, tab 18
- button "Delete channel" 21, 102 28 39 10, tab 18
- button "Get List" 22, 102 43 39 10, tab 18
- }
- on *:dialog:DiceControls:init:0:{
- var %die.amount $readini(dice.ini,dicectrl,die.amount), %die.side $readini(dice.ini,dicectrl,die.side), %msgclr $readini(dice.ini,dicectrl,msgclr)
- didtok $dname 9 44 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100
- didtok $dname 10 44 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100
- didtok $dname 11 44 black,dark grey,lighter grey,light grey,lightest grey,Red,bright green,Blue,bright yellow,light blue,pink,dark blue,Brown,Purple,dark green
- didtok $dname 12 44 Normal,Bold,Italic,Underline
- $iif(%die.amount,did -c $dname 9 %die.amount,did -c $dname 9 1)) | $iif(%die.side,did -c $dname 10 %die.side,did -c $dname 10 1))
- $clr.sel
- $style.sel
- }
- on *:dialog:DiceControls:sclick:*:{
- if ($did == 5) { set %msg.st $true | unset %msg.user }
- if ($did == 6) { set %msg.st $false | unset %msg.chan }
- if ($did == 9) { writeini -n dice.ini dicectrl die.amount $did(9).seltext | /did -ra $dname 23 Die amount set and saved to $chr(40) $+ $did(9).seltext $+ $chr(41) }
- if ($did == 10) { writeini -n dice.ini dicectrl die.side $did(10).seltext | /did -ra $dname 23 Die sides set and saved to $chr(40) $+ $did(10).seltext $+ $chr(41) }
- if ($did == 11) { writeini -n dice.ini dicectrl msgclr $did(11).seltext | set %msgclr $did(11).seltext | $msgcolor | /did -ra $dname 23 Text message font color set and saved to $chr(40) $+ $did(11).seltext $+ $chr(41) }
- if ($did == 12) { writeini -n dice.ini dicectrl msgstyle $did(12).seltext | set %msgstyle $did(12).seltext | /did -ra $dname 23 Text message font style set and saved to $chr(40) $+ $did(12).seltext $+ $chr(41) | $style.sel }
- if ($did == 15) { remini -n dice.ini dicectrl die.amount }
- if ($did == 16) { remini -n dice.ini dicectrl die.side }
- if ($did == 18) { chan.list }
- if ($did == 19) { set %chan.num $did(19).sel }
- if ($did == 20) { /did -a $dname 19 $active | set %add $readini(dice.ini,dicectrl,channels) | set %channel $remove($active,$chr(37),$chr(35)) | $iif($readini(dice.ini,dicectrl,chan.count),writeini -n dice.ini dicectrl chan.count $calc($readini(dice.ini,dicectrl,chan.count) + 1),writeini -n dice.ini dicectrl chan.count 1)) | $iif(%add,writeini -n dice.ini dicectrl Channels $addtok(%add,%channel,32),writeini -n dice.ini dicectrl channels %channel)) }
- if ($did == 21) { /did -d $dname 19 %chan.num | writeini -n dice.ini dicectrl chan.count $calc($readini(dice.ini,dicectrl,chan.count) - 1) | if ($readini(dice.ini,dicectrl,chan.count) == 0) { remini dice.ini dicectrl channels | goto end } | set -u60 %channels $readini(dice.ini,dicectrl,channels) | writeini -n dice.ini dicectrl channels $deltok(%channels,%chan.num,32)) | :end }
- if ($did == 22) { chan.list }
- }
- ::::Menu's::::
- menu menubar {
- -
- Dice Options
- .Dices ( $+ $group(#Dices) $+ )
- ..ON:.enable #Dices
- ..OFF:.disable #Dices
- .Set mIRC.Message color:{ set %dicemsgcolor $+ $$?"Input Color 1-15" }
- .Dice controls:{ dialog -dm DiceControls DiceControls }
- -
- }
- on *:load:{ writeini -n dice.ini dicectrl die.amount 0 | writeini -n dice.ini dicectrl die.side 0 | writeini -n dice.ini dicectrl chan.count 0 | var_cb }
Advertisement
Add Comment
Please, Sign In to add comment