mIRC Home    About    Download    Register    News    Help

Print Thread
#58644 01/11/03 10:30 AM
Joined: Sep 2003
Posts: 11
A
Pikka bird
OP Offline
Pikka bird
A
Joined: Sep 2003
Posts: 11
i'm not sure about this but me and some of my friends are having problems with isin. Sometimes it don't work, sometimes work but the most commom behavior is when you use more than one isin at consecutive ifs (I use them this way to check /commands -params). The /command i'm having trouble with is this one (all the parameters can go together...):

Code:
drawbutton {
  if (-* iswm $1) { if ($remove($1,-) !isin fscd) { return } | var %win = $iif(@* iswm $2,$2,@ $+ $2),%x = $3,%y = $4,%w = $5,%h = $6,%font = $iif($7 == *,Tahoma,$7),%size = $iif($8 isnum,$8,-8),%text = $9- }
  else { var %win = $iif(@* iswm $1,$1,@ $+ $1),%x = $2,%y = $3,%w = $4,%h = $5,%font = $iif($6 == *,Tahoma,$6),%size = $iif($7 isnum,$7,-8),%text = $8- }
  var %twin = @btn- $+ $remove(%win,@)
  if ($window(%twin)) { window -c %twin } | window -hCpB +d %twin 0 0 %w %h
  drawrect -rf %twin $rgb(face) 0 0 0 %w %h
  if (-* !iswm $1) || (b isin $1) {
    drawrect -r %twin $rgb(hilight) 1 0 0 %w %h
    drawline -r %twin $rgb(shadow) 1 $calc(%w -2) 1 $calc(%w -2) $calc(%h -2) 0 $calc(%h -2)
    drawline -r %twin $rgb(3dlight) 1 1 $calc(%h -3) 1 1 $calc(%w -2) 1
    drawline -r %twin $rgb(64,64,64) 1 0 $calc(%h -1) $calc(%w -1) $calc(%h -1) $calc(%w -1) -1
  }
  if (f isin $1) { drawrect -r %twin $rgb(frame) 1 0 0 %w %h | drawrect -r %twin $rgb(hilight) 1 1 1 $calc(%w -2) $calc(%h -2) }
  if (c isin $1) { drawrect -r %twin $rgb(frame) 1 0 0 %w %h | drawrect -r %twin $rgb(shadow) 1 1 1 $calc(%w -2) $calc(%h -2) }
  if (d isin $1) {
    var %w = %w - 1,%h = %h - 1
    drawrect -r %twin $rgb(frame) 1 0 0 $calc(%w +1) $calc(%h +1)
    drawrect -r %twin $rgb(hilight) 1 1 1 %w %h
    drawline -r %twin $rgb(shadow) 1 $calc(%w -3) 2 $calc(%w -3) $calc(%h -3) 1 $calc(%h -3)
    drawline -r %twin $rgb(3dlight) 1 1 $calc(%h -4) 2 2 $calc(%w -3) 2
    drawline -r %twin $rgb(64,64,64) 1 1 $calc(%h -2) $calc(%w -2) $calc(%h -2) $calc(%w -2) 1
  }
  if ($len(%text)) {
    var %tw = $width(%text,%font,%size,0,1),%th = $height(%text,%font,%size)
    var %tx = $int($calc(($window(%twin).w - %tw) /2)),%ty = $int($calc(($window(%twin).h - %th) /2))
    if (%tx <= 0) { var %tx = 2 }
    if (%ty <= 0) { var %ty = 2 }
    if (%tw > $calc($window(%twin).w -4)) { %tw = $calc($window(%twin).w -4) }
    if (%th > $calc($window(%twin).h -4)) { %th = $calc($window(%twin).h -4) }
    drawtext -rpcb %twin $rgb(text) $rgb(face) %font %size %tx %ty %tw %th %text
  }
  if (s isin $1) { drawrect -rc %twin $rgb(frame) 1 3 3 $calc(%w -6) $calc(%h -6) }
  drawcopy %twin 0 0 $window(%twin).w $window(%twin).h %win %x %y | window -c %twin
  return %x %y %w %h
}



it's not finished (I stopped because of the isin problem, and almost the same behavior ocurred when i tried with iswm...) and /drawbutton -bdfsc @window x y w h FontName FontSize Text (it creates a button that is just like Windows' but with BURK in it's text)... and i'm sorry for my english frown


Why do I still go to school if the destiny is death?
#58645 01/11/03 10:54 PM
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
You said it doesn't work, however, you didn't specify what happens, nor how it happens.

- What does it do when not "working" (eg. halts the script, doesn't get triggered etc. (check it debugging with /echo))?
- In case it doesn't behave like it should, how should it then?
- What parameters/syntax did you use to reproduce the issue?

I've been using the isin operator a lot, consecutively or not, and it's been working fine.

Last edited by cold; 01/11/03 11:01 PM.

* cold edits his posts 24/7
#58646 02/11/03 06:21 PM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
Too bad your script isn't finished, but it has nothing to do with the bug you were posting. Were you just trying to show off your code or what?

...Explain the bug


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard