Top

User Control Panel


mIRC Code
+ 1 likes
Please Register to submit score.
Bookmark and Share
Average Score  4.0 (of 3 scores)
Date Added  May 20, 2008
Last Updated  May 22, 2008
Tags  control  dialog  hash  mirc  panel  tables  user 

Introduction

This is a plain jane Dialog User Control Panel with some basic addons :)

Hope you like it :)

Cheers

Grab the Code

; Pythons-IRC 3.0
dialog UCP {
  title "                                          User Control Panel"
  size -1 -1 250 240
  option dbu
  list 1, 15 110 70 104, size
  box "", 2, 5 20 235 67
  text "User Settings", 3, 102 7 45 10, center
  text "NickName", 4, 15 60 35 10, center
  edit "", 5, 60 60 50 10
  edit "", 6, 60 75 50 10
  text "Alternate Nick", 7, 15 75 35 10, center
  edit "Password", 10, 120 75 50 10, pass
  edit "Password", 11, 120 60 50 10, pass
  text "User", 8, 15 30 35 10, center
  edit "", 9, 60 30 50 10
  edit "Email ID", 12, 60 45 50 10
  text "Email ID", 13, 15 45 35 10, center
  box "", 14, 10 100 230 123
  text "Channels", 15, 102 93 45 8, center
  button "Add Channel", 16, 100 110 60 10
  button "Remove Channel", 17, 100 125 60 10
  button "Clear Channels", 18, 100 140 60 10
  button "OK", 19, 203 225 37 12, ok
  button "Close", 20, 10 225 37 12, cancel
}
 
on *:LOAD: {
if ($hget(Channel) != Channel) {
hmake Channel 10 }
if ($exists($mircdirHash\Channel.hsh) == $true) { hload Channel $mircdirHash\Channel.hsh }
else { hsave Channel $mircdirHash\Channel.hsh } }
;
;
on *:DIALOG:ucp:init:0: {
.timer -m 1 1 UCP.an
set %user $readini(mirc.ini, mIRC, user)
set %emailid $readini(mirc.ini, mIRC, email)
set %nick $readini(mirc.ini, mIRC, nick)
set %anick $readini(mirc.ini, mIRC, anick)
did -ra ucp 5 %nick
did -ra ucp 6 %anick
did -ra ucp 9 %user
did -ra ucp 12 %emailid
did -ra ucp 10 %anickpass
did -ra ucp 11 %nickpass
hload Channel $mircdirHash\Channel.hsh
writechan }
 
;Trigger Dialog
on *:DIALOG:ucp:sclick:*: {
if ($did == 16) { addchan }
if ($did == 17) { remchan }
if ($did == 18) { clearchan }
if ($did == 19) {
set %nickpass $did(11)
set %nickpass $did(10) } }
;
;
;Aliases
;
;
;Add Channel
alias addchan {
dialog -n UCP UCP
set %channame $$?="Channel Name?"
if ($left(%channame,1) != $chr(35)) { 
%channame = $chr(35) $+ %channame }
if (%chanlist == $null) { 
set %chanlist 0 }
inc %chanlist
did -i ucp 1 %chanlist %channame
hadd -m Channel %channame
hsave Channel $mircdirHash\Channel.hsh
hload Channel $mircdirHash\Channel.hsh }
;
;
;Remove Channel
alias remchan {
var %linen = $did(ucp,1,1).sel
did -d ucp 1 %linen
hdel -w Channel %linen
hsave Channel $mircdirHash\Channel.hsh
hload Channel $mircdirHash\Channel.hsh
dec %chanlist }
;
;
;Channel Lister
alias writechan {
if (%chanlist != $null) {
var %i 1
while (%i <= %chanlist) {
did -i ucp 1 %i $hget(Channel, $+ %i).item
inc %i } }
else return }
;
;
;Clear Channel List
alias clearchan {
if (%chanlist != $null) {
if ($hget(Channel) == Channel) {
hfree channel
hmake Channel 10
hsave Channel $mircdirHash\Channel.hsh
dialog -x ucp ucp
dialog -mado ucp ucp
unset %chanlist } } }
;
;
on *:CONNECT: {
if ($me == %nick) { nickserv identify %nickpass }
if (%chanlist != $null) {
var %i 1
while (%i <= %chanlist) {
join $hget(Channel, %i $+ ).item
inc %i } } }
 
alias UCP {
  if ($dialog(UCP)) {
    dialog -c UCP UCP
    dialog -mado UCP UCP
  }
  else { dialog -mado UCP UCP }
} 
 
alias UCP.an {
  var %w = 250
  var %h = 240
  var %i 0
  var %j 0
  while (%j <= %h) {
    dialog -srb UCP -1 -1 %i %j
    var %t 1
    while (%t <= 80) inc %t
    inc %j
    inc %i $calc(%w / %h)
  }
} 
 

Comments

  (3)  RSS
Jack_Sparrow
Comments: 9
 
mIRC Snippet:  User Control Panel
Posted on May 20, 2008 6:42 am
Edited it to Make it Hash Table Based ;)
jonesy44
Comments: 1,856
 
mIRC Snippet:  User Control Panel
Posted on May 20, 2008 11:25 am
make;
Code:
set %i 1

..
Code:
var %i 1
Jack_Sparrow
Comments: 9
 
mIRC Snippet:  User Control Panel
Posted on May 21, 2008 5:24 am
Edited it to make it use local variables :)
Thx Jonesy44

Commenting Options

Register or Login to Hawkee.com or use your Facebook or Twitter account by clicking the corresponding button below.

  
Bottom