Jump to content

hixxy

Members
  • Posts

    72
  • Joined

  • Last visited

Everything posted by hixxy

  1. That's not what I meant. I meant that let's say you scroll halfway down a buffer, so the 50th line in the buffer is now the first visible line in the box. There's no way you can find out which line is the first visible one (ie. the first line to appear on the screen, at the top). However, I misunderstood what you were asking. It's 100% possible in picture windows but it'll be a hell of a lot of work. You'll have to make all sorts of $width/$height calculations, as well as adding/subtracting values for padding around the text, etc. You'll have to store all data that you draw onto the window somewhere since mIRC doesn't keep an internal buffer for picture windows. You'll have to store fontname, fontsize, whether it's bold, etc as well, because you're going to have to work out the exact coordinates of each word to do what you want to do. I'll make up a small example that supports only a couple of lines then you might wish to extend it to a full blown buffering system or something. Rather than comment the code (I'm no good at explaining things unless I have a specific question to answer), ask me any questions about the code if you don't understand it. /* Tell the script how the text will appear. $bold - specifies whether the text will be bold or not. $font - returns the font name. $fontsize - returns the font size. $leftspacing - returns the number of pixels between the left of the window and the text. $linespacing - returns the number of pixels between each line. */ alias -l bold { return $false } alias -l font { return courier new } alias -l fontsize { return 10 } alias -l leftspacing { return 5 } alias -l linespacing { return 2 } alias -l addline { var %i = 1, %y = $linespacing while ($hget(hotlinks_buffer,%i) != $null) { %y = $calc(%y + $height($v1,$font,$fontsize) + $linespacing) inc %i } drawtext $iif($bold,-o) @hotlinks 1 $qt($font) $fontsize $leftspacing %y $1- hadd -m hotlinks_buffer $calc($hget(hotlinks_buffer,0).item + 1) $1- } alias -l makebuffer { window -dkp @hotlinks } alias phe { if ($hget(hotlinks_buffer)) { hfree $v1 } makebuffer addline Hello there, addline hover over any of these words and the word you're hovering should echo in the status window. } on *:close:@hotlinks:{ if ($hget(hotlinks_buffer)) { hfree $v1 } } menu @hotlinks { mouse:{ var %i = 1, %data, %y = $linespacing while ($hget(hotlinks_buffer,%i) != $null) { %data = $v1 if ($mouse.y isnum $+(%y,-,$calc(%y + $height(%data,$font,$fontsize)))) { var %g = 1, %x = $leftspacing, %word while ($gettok(%data,%g,32) != $null) { %word = $v1 if ($mouse.x isnum $+(%x,-,$calc(%x + $width(%word,$font,$fontsize,$iif($bold,1,0),0)))) { echo -a HOVERED WORD: %word ~ COORDS: %x %y return } %x = $calc(%x + $width(%word $+ $chr(32),$font,$fontsize,0,0)) inc %g } } %y = $calc(%y + $height(%data,$font,$fontsize) + $linespacing) inc %i } } } Type /phe to run the example. Hover over any word in the window and it should echo in the status window. I know this isn't exactly what you asked for, but the code that finds out exactly where the coordinates of the words you're after is in there, so feel free to use it in your own. Edit: this is an incredibly simple buffering system. It doesn't take scrolling into account (having to use a scrollbar when text overflows), or when text is too wide to fit on one line. You'll have a lot more work to do than this simple example.
  2. That's fine, but he said the channels start with a %. Timers evaluate things twice so mIRC will interpret %#channel as a variable. To avoid that you can use the code provided by me or Psycho. Psycho's method is shorter but I find it more kludgy. It's much harder to read.
  3. Not possible. There's no way of knowing which line is the first visible line in the window.
  4. hixxy

    question

    $regml() is only filled when a regex matches something that was found within capturing brackets: Test:{ var %a = $regex(tz,to TEST this,/([A-Z])/g) echo -a %a - $regml(tz,1) } The () inside of $regex() is the key here.
  5. $chan would be evaluated when the timer command is used, not when the timer fires, so it would from any event/location that $chan exists in. However, your variable idea would be the best way to do this. Something like this would work well: on *:join:#:{ set %chan $chan .timerblah 1 5 dowhatever } alias dowhatever { msg %chan hello unset %chan }
  6. And in this case there are only four options; use MDX, use DCX, draw it yourself or write your own GUI dll. I very much doubt the person has the ability to do either of the last two options considering he had to ask *how* he could make a panel, so that leaves only two options; use MDX or use DCX, both of which have been done many times before and will be done many times again. This is NOT ripping.
  7. Ripping is using code without permission and THEN claiming you wrote it. If I steal your code without asking you but write a comment in the file saying ; Kronicdreamer wrote this: I haven't ripped a thing. Whilst I think people should respect the author's wishes regarding using their code, I think if people care deeply about having their code ripped they shouldn't release their code. I guess everyone has their own definition though. No matter how you define it though, classing what he asked for as ripping is idiotic in my opinion. He asked how he can make a control panel like the one in that script. In no way, shape or form did he mention he was going to steal the code or make an exact copy of the panel.
  8. hixxy

    Room Lister

    You can't. A workaround is to hide the window when it opens (start of list raw) with /window -h and close it when the list finishes (end of list raw) with /close or /window -c. The window name is "channels list" (including the quotes)
  9. You could easily trick it inadvertedly.
  10. That's not a reliable way of checking. Making a root\ directory in the mIRC directory will trick that script.
  11. hixxy

    hos.dll

    All I'm saying is that randomly moving files around in a program/script install directory is asking for trouble. If it breaks, that's the fault and problem of the user that moved said files around, not the author of the script that would work if it was left as it was. I think that users should be able to move the *entire* script to a different directory (eg: c:\coolscript\ to c:\program files\coolscript\) but not move files within the script directory to a different directory (eg: c:\coolscript\dlls\mdx.dll to c:\coolscript\mdx.dll). Also, this isn't a pissing contest, I'm just trying to help.
  12. hixxy

    hos.dll

    I don't think idiot proofing your script is worth the speed decrease that users with half a brain will suffer from
  13. hixxy

    ban lister

    Then you're not using an IRC compliant server, so none of us can help you anyway.
  14. hixxy

    ban lister

    Double click on a channel window.
  15. hixxy

    hos.dll

    Well yeah, I guess so, but the point still stands that you'll be better off hardcoding the path.
  16. hixxy

    hos.dll

    Just thought I'd mention that the $findfile there literally does nothing. $findfile($mircdir,hos.dll,1) will ALWAYS be $mircdirhos.dll.
  17. hixxy

    URL Based (IRC)

    You can use the on hotlink event to catch dclicks on URLs.
  18. hixxy

    Find option

    on *:text:@find *:*:{ set %nick $nick filter -fk <file> sendto * $+ $2-* unset %nick } alias sendto { if (%nick != $null) msg $v1 $1- }
  19. hixxy

    Sockbot(debate)

    I can think of one use for it; being able to have a bot without having any of the data it receives display anywhere.
  20. on *:input:@wallops: wallops $1-
  21. Peter's is a lot faster. I believe my $reverse alias slows it down a lot.
  22. hixxy

    why?

    If we're going to go into details it actually means if $2 is a number between 0 and 100 it will ban for that amount of minutes, but if $2 is any other value it will ban forever.
  23. hixxy

    CTCP

    ctcp *:*:*:{ if ($nick == $me) return hinc -mu30 ctcpflood $+ $cid $wildsite if ($hget(ctcpflood $+ $cid,$wildsite) == 5) { echo 04 -a $str($chr(160),10) $nick has requested 5 ctcps from you in 30 seconds. Ignoring all ctcps... Type /uctcp to remove ignores. .ictcp hfree ctcpflood $+ $cid } else echo 04 -a $str($chr(160),10) You were $1 checked by $nick $+ . To ignore CTCPs type /ictcp and to remove /uctcp } alias ictcp ignore -tw *!*@* alias uctcp ignore -rw *!*@* This will allow 5 ctcps in 30 seconds. To change the no. of seconds change "hinc -mu30" to "hinc -mu<number of seconds>". To change the no. of allowed ctcps change "if ($hget(ctcpflood $+ $cid,$wildsite) == 5)" to "if ($hget(ctcpflood $+ $cid,$wildsite) == <number of seconds>)"
  24. Add these two aliases: alias removerepeats return $reverse($regsubex($reverse($1),/(.)(?=.*?\1)/g,)) alias reverse { var %string = $1 return $regsubex($1,/(.)/g,$mid(%string,-\n,1)) } Then you can use: //echo -a $removerepeats(andHhshabdyPcvjshHP) = andHhsbyPcvj If you don't have mIRC 6.17 use this instead: alias regsubex { var %a, %b = $regsub($1,$2,$3,%a) return %a } alias removerepeats return $reverse($regsubex($reverse($1),/(.)(?=.*?\1)/g,)) alias reverse { var %i = 1, %value while ($mid($1,%i,1) != $null) { %value = $v1 $+ %value inc %i } return %value }
×
×
  • Create New...