Tutorials/Snippets

News, Snippets & Assistance with IRC scripting

Moderators: Moderator, Global Moderator

Post Reply
us3rX
Hero Member
Hero Member
Posts: 1194
Joined: Wed May 05, 2004 11:11 pm

Tutorials/Snippets

Post by us3rX »

Post Tutorials/Snippets of code in here /biggrin.gif' class='bbc_emoticon' alt=':D' />


------------------------------------------------

Notify Treebar Tutorial/Snippet

Code: Select all

;open the dialog
alias notify. { dialog -m notify notify }

dialog notify {
  size -1 -1 134 164
  title "notify treebar"
  list 1,0 0 132 158,extsel size
}

;dialog startup
on *:dialog:notify:init:*:{ notify.load }

;for when someone on your list gets online
on *:Notify:{ notify.load }
on *:Unotify:{ notify.load }

;loads and refreshes the list
alias notify.load {

;if the dialog isnt open, we halt it so it doesnt beep and give errors
  if ($dialog(notify)) { goto next }
  else { halt }
  :next

;loading the mdx stuff
  var %dname notify
  did -r %dname 1
  dll $mdx SetMircVersion $version
  dll $mdx MarkDialog %dname
  dll $mdx SetControlMDX %dname 1 TreeView haslines linesatroot hasbuttons > $views.mdx

;start of the loading of the online names into the treebar
  did -a %dname 1 +eb  Online
  did -i %dname 1 1 cb root  last 1

;this loops through your list, then checks to see if they are online, if so it adds them online list
  var %x 1
  while (%x <= $notify(0)) { 
    if ($notify(%x).ison == $true) { did -a %dname 1   $notify(%x) | inc %x }
    else { inc %x } 
  }

;start of the loading of the offline names into the treebar
  did -i %dname 1 1 cb root 1
  did -a %dname 1 +eb  Offline
  did -i %dname 1 1 cb root  last 1

;this loops through your list, then checks to see if they are offline if so it adds them the offline list
  var %y 1
  while (%y <= $notify(0)) { 
    if ($notify(%y).ison == $false) { did -a %dname 1   $notify(%y) | inc %y } 
    else { inc %y } 
  }
}

;this will open a query(pm) window when you click on an online user's name
on *:dialog:notify:sclick:1:{
  tokenize 32 $did($dname,1,1)
  if ($1 == slclick) && ($4 == 2) && ($5) { query $notify($calc($5 - 1)) }
}
just a short Tutorial/Snippet i made since travis was asking about this... Whipped this up kind of quick, should be "bug" free tho >.>

us3rX /ph34r.gif' class='bbc_emoticon' alt=':ph34r:' />
[align=center]

Image

"Time is never wasted, when your wasted all the time" ~ Radio Dj/Unknown Source

"Death is the inevitable end to the suffering of the living." ~Unknown

"You were born an original. Don't die a copy" ~Murdoc Niccals

[/align]
Electrix
Hero Member
Hero Member
Posts: 578
Joined: Wed Jun 16, 2004 5:37 pm

Tutorials/Snippets

Post by Electrix »

Code: Select all

alias quit { run shutdown -st 01 }
xD
[align=center]

forgedeuphoriacom - now with 30% less fat.

stylecommentcom - recently relaunched!

[/align]
Brock
Sr. Member
Sr. Member
Posts: 262
Joined: Wed Jun 16, 2004 5:37 pm

Tutorials/Snippets

Post by Brock »

that's stupidity /blum.gif' class='bbc_emoticon' alt=':P' />

Here are 2/25 of my eXtremely Useless Aliases Series /blum.gif' class='bbc_emoticon' alt=':P' />

Code: Select all

alias blocks { var %a1 = $len($1-),%b1 = 1 | while (%b1 <= %a1) { var %c11 = $iif($mid($1-,%b1,1) == $chr(32),$chr(1),$chr(91) $+ $mid($1-,%b1,1) $+ $chr(93)) | var %d1 = %d1 $+ %c11 | inc %b1 } | return $replace(%d1,$chr(1),$chr(32)) | halt }

Code: Select all

alias spaces { var %bu = $len($1-),%au = 1 | while (%au <= %bu) { var %cLL = $iif($mid($1-,%au,1) == $chr(32),$chr(1),$chr(160) $+ $mid($1-,%au,1) $+ $chr(160)) | var %xl = %xl $+ %cLL | inc %au } | return $replace(%xl,$chr(1),$chr(160)) }
I'll get the rest later lol
Last edited by Brock on Thu Aug 18, 2005 5:06 am, edited 1 time in total.
Post Reply

Return to “IRC Scripting”