Jump to content

Help with Status Bar.


JeremyStCyr

Recommended Posts

Ok i got everything i wanted to do with my status bar, but ran into a few issues and not sure how to fix it, the issue is when the script starts up the Status bar will show like a regular dialog(screenshot 1) instead of displaying like this(2nd screenshot) for some reason, it will do this only on minimize the second screenshot will, in my status screen i have this error D_ERROR /xdid (Unknown dialog "sbar": see Mark command)

 

here is the code i decided to do.

also how can i get my status bar to do the ticks with uptime stuff, as in keep on counting, minimize is only way it will update ?

	alias sbar {
  If ($Dialog(sbar)) { Dialog -x Sbar Sbar | Dialog -m sbar sbar }
  Else {
    dialog -m sbar sbar
  }
}
	on *:start:{ sbar }
	dialog sbar {
  title "status bar"
  option dbu
  size -1 -1 1600 1
}
	on *:dialog:sbar:*:*: {
  if ($devent == init) {
    dcx Mark $dname sbar_cb
    xdialog -g sbar +b $color(1)
    xdialog -c $dname 1 statusbar 0 1 1600 8
    xdid -l sbar 1 185 200 150 -1
    xdid -l sbar 1 200 200 200 -1
    xdid -l sbar 1 250 200 250 -1
    xdid -l sbar 1 300 200 300 -1
    xdid -w sbar 1 +a 0 halodialogs\dcxbar\icons\server.ico
    xdid -w sbar 1 +a 0 halodialogs\dcxbar\icons\nick.ico
    xdid -w sbar 1 +a 0 halodialogs\dcxbar\icons\computer.ico
    xdid -w sbar 1 +a 0 halodialogs\dcxbar\icons\record.ico
    xdid -t sbar 1 1 +n 1 Server: $server
    xdid -t sbar 1 2 +n 2 NickName: $nick
    xdid -t sbar 1 3 +n 3 Uptime: $uptime(system,1)
    xdid -t sbar 1 4 +n 4 Record Uptime: %systemup.format.record
    xdock -m $dialog(sbar).hwnd +b
  }
}
alias sbar_cb { }
On *:Active:*:{
  xdid -v sbar 1 1 Server: $server
  xdid -v sbar 1 2 NickName: $nick
  xdid -v sbar 1 3 Uptime: $uptime(system,1)
  xdid -v sbar 1 4 Record Uptime: %systemup.format.record
}

and in alias i am using

;DCX Tools
dir.dll { return $shortfn($mircdir) $+ dlls\ }
dcx { if ($isid) returnex $dll($dir.dll $+ dcx.dll,$1,$2-) | else dll " $+ $dir.dll $+ dcx.dll" $1 $2- }
udcx { if ($dcx(IsUnloadSafe)) $iif($menu, .timer 1 0) dll -u dcx.dll | else echo 4 -qmlbfti2 [DCX] Unable to Unload Dll. }
xdid { if ( $isid ) returnex $dcx( _xdid, $1 $2 $prop $3- ) | dcx xdid $2 $3 $1 $4- }
xdialog { if ( $isid ) returnex $dcx( _xdialog, $1 $prop $2- ) | dcx xdialog $2 $1 $3- }
xdock { if ($isid) returnex $dcx( _xdock, $1 $prop $2- ) | dcx xdock $1- }
xstatusbar { !if ($isid) returnex $dcx( _xstatusbar, mIRC $prop $1- ) |  dcx xstatusbar $1- }
xtreebar { !if ($isid) returnex $dcx( _xtreebar, mIRC $prop $1- ) | dcx xtreebar $1- }
xtray { if ($isid) returnex $dcx(TrayIcon, $1 $prop $2-) | dcx TrayIcon $1- }
xpop { if ( $isid ) returnex $dcx( _xpop, $1 $prop $2- ) | dcx xpop $2 $1 $3- }
xpopup { if ( $isid ) returnex $dcx( _xpopup, $1 $prop $2- ) | dcx xpopup $2 $1 $3- }
xmenubar { if ($isid) returnex $dcx(_xmenubar, $prop $1-) | dcx xmenubar $1- }
mpopup { dcx mpopup $1 $2 }
dcxml dcx dcxml $1-
tab {
  var %i = 1, %tab
  while (%i <= $0) {
    if ($eval($+($,%i),2) != $null) { %tab = $instok(%tab,$eval($+($,%i),2),$calc($numtok(%tab,9) + 1),9) }
    inc %i
  }
  return %tab
}

So i know my alias is there :P

if anyone can help thanks :D

 

status bar.png

rightway.png

Edited by JeremyStCyr
Link to comment
Share on other sites

alias sbar {
  if ($dialog(sbar)) { dialog -x sbar sbar | Dialog -m sbar sbar }
  else { dialog -m sbar sbar }
}
on *:start: { sbar }

dialog sbar {
  title "status bar"
  option dbu
  size -1 -1 1600 1
}
on *:dialog:sbar:*:*: {
  if ($devent == init) {
    dcx Mark $dname sbar_cb
    xdialog -g sbar +b $color(1)
    xdialog -c $dname 1 statusbar 0 1 1600 8
    xdid -l sbar 1 185 200 150 -1
    xdid -l sbar 1 200 200 200 -1
    xdid -l sbar 1 250 200 250 -1
    xdid -l sbar 1 300 200 300 -1
    xdid -w sbar 1 +a 0 halodialogs\dcxbar\icons\server.ico
    xdid -w sbar 1 +a 0 halodialogs\dcxbar\icons\nick.ico
    xdid -w sbar 1 +a 0 halodialogs\dcxbar\icons\computer.ico
    xdid -w sbar 1 +a 0 halodialogs\dcxbar\icons\record.ico
    xdid -t sbar 1 1 +n 1 Server: $server
    xdid -t sbar 1 2 +n 2 NickName: $nick
    xdid -t sbar 1 3 +n 3 Uptime: $uptime(system,1)
    xdid -t sbar 1 4 +n 4 Record Uptime: %systemup.format.record
    xdock -m $dialog(sbar).hwnd +b
  }
}
alias sbar_cb { }
On *:Active:*:{
  if ($dialog(sbar)) {
    xdid -v sbar 1 1 Server: $server
    xdid -v sbar 1 2 NickName: $nick
    xdid -v sbar 1 3 Uptime: $uptime(system,1)
    xdid -v sbar 1 4 Record Uptime: %systemup.format.record
  }
}

The on active was causing part of the issue. Needed to make sure the dialog existed before trying to xdid.

Link to comment
Share on other sites

alias sbar {
  xstatusbar -A 0
  xstatusbar -A 1 notheme 
  xstatusbar -f + ansi 10 Calibri
  xstatusbar -k 2894892
  xstatusbar -l 1% 20% 20% 30% -1
  xstatusbar -w + 0 halodialogs\dcxbar\icons\server.ico
  xstatusbar -w + 0 halodialogs\dcxbar\icons\nick.ico
  xstatusbar -w + 0 halodialogs\dcxbar\icons\computer.ico
  xstatusbar -w + 0 halodialogs\dcxbar\icons\record.ico
  xstatusbar -t 1 +fn 0 $chr(9)
  xstatusbar -t 2 +fn 1 00Server: $iif($status == disconnected,$status,$server)
  xstatusbar -t 3 +fn 2 00Nick: $me
  xstatusbar -t 4 +fn 3 00Uptime: $uptime(system,1)
  xstatusbar -t 5 +fn 4 00Record Uptime: $iif(%systemup.format.record,%systemup.format.record,n/a)
}
on *:start: { sbar }
on *:active:*: {
  if ($xstatusbar().visible == $true) { 
    xstatusbar -v 2 +fn 00Server: $iif($status == disconnected,$status,$server)
    xstatusbar -v 3 +fn 00Nick: $me
    xstatusbar -v 4 +fn 00Uptime: $uptime(system,1)
    xstatusbar -v 5 +fn 00Record Uptime: $iif(%systemup.format.record,%systemup.format.record,n/a)
  }
}

NOTE: the 00 infront of the the section names like Server: is the mirc color code.. Insert the CTRL + K in front of them. you can also use bold and italic etc

 

more info on xstatusbar @ https://www.tg007.net/dcx/xstatusbar.htm

Link to comment
Share on other sites

  • Site Moderator
Quote

on *:START: { r.sb }
on *:ACTIVE:*:{ u.sb }
alias r.sb { xstatusbar -A 0 notheme | xstatusbar -A 1 notheme | .timer -m 2 8 u.sb }
alias u.sb {
  var %s xstatusbar, %c $+ $color(info)
  %s -f +a ansi 10 Segoe UI
  %s -k $color($color(editbox))
  %s -l 250 120 310 300 100%
  ;Content
  %s -t 1 +fn 1 %c Server: $(add server here)
  %s -t 2 +fn 2 %c Lag: $hget(lag,lag) ms
  %s -t 3 +fn $iif($sock(Server here.*),$iif($hget(lag,lag) >= 100,5,3) %c Connection Uptime: $uptime(server,1),4 05 Disconnected) 
  %s -t 4 +fn 6 %c Script Runtime: $uptime(mirc,1) 
  %s -t 5 +fn 7 %c System Uptime: $uptime(system,1) 
  ;Gen Icons
  %s -w + 0 images\
  %s -w + 0 images\
  %s -w + 0 images\
  %s -w + 0 images\   <--- Here you add your icons
  %s -w + 0 images\
  %s -w + 0 images\
  %s -w + 0 images\
}

I know err0rs is much simplier 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...