mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 3 1 2 3
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
k, thx ppl.. i thought about that last night as i was going to sleep so, and i also thought about using a dll, but i dont want to do that... so thx anyway


This is not the signature you are looking for
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Yeah, you're right. Not sure what I was thinking. shocked


Invision Support
#Invision on irc.irchighway.net
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
next topic:
whats an easy way to check if the mouse is in x which is listed in a hash file(using while loops to check for multi)

used to check if press is in a button


This is not the signature you are looking for
Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
Depending on how your hash table is :

Code:
var %a = $hfind(table,$+($mouse.x,.*),0,w)
while (%a) { echo -a $hfind(table,$+($mouse.x,.*),%a,w) | dec %a }
In this exemple your item should be like X.Y, it list all match for the X value.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
thx


This is not the signature you are looking for
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
so, how do i get this to work...
Code:
  uclick: { if ($hget($active) == $active) { 
      var %x $hfind($active,$+($mouse.x,.*),0,w),%y $hfind($active,$+($mouse.y,.*),0,w)
      if (while (%a) { echo -a $hfind($active,$+($mouse.x,.*),%a,w) | dec %a } >= 20) && (while (%a) { echo -a $hfind($active,$+($mouse.x,.*),%a,w) | dec %a } >= 30) {
        window -c $active
        ;if ($inrect($mouse.x,$mouse.y,20,60,180,20)) {
        ;window -c $active
  } } }

Last edited by foshizzle; 19/01/08 02:58 AM.

This is not the signature you are looking for
Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
Hum, i'm not sure about what you mean since you don't use the right syntax.
Quote:
if ($hget($active) == $active) {
could be
Quote:
if ($hget($active))

Code:
var %x $hfind($active,$+($mouse.x,.*),0,w),%y $hfind($active,$+($mouse.y,.*),0,w)
You're using wildcare incorrectly here, %y should be :
Code:
$hfind($active,$+(*.,$mouse.y),0,w)

You're using %x %y but the while is based on %a
you have an /while inside an /if statement
one of your condition is a /while...
explain more precisely what you want ? smile


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
i have my hash table that looks like this

item ID - name (hash name is @Gui in this case)

1 - button X Y W H Text
2 - box X Y W H Text
3 - text X Y W H Text

i want it to search all the IDs and see if any of them are buttons then i want to tokenize the values and use them to see if its pressed in that area

ex :

1 - button 10 10 100 20 blah

i want to be able to click at 10 10 100 20 and do the event



This is not the signature you are looking for
Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
Code:
uclick:{
if ($hget($active)) { 
var %exid = $regsubex($str(a,$hget($v1,0).item),/a/g,$+($isclick($mouse.x,$mouse.y,$gettok($hget($v1,\n).data,2-6,32),\n),.))
 }
}

alias isclick tokenize 32 $1- | return $iif($inrect($1,$2,$3,$4,$5,$6),$7)
Something like that should works, the $regsubex should return all Ids that match the X Y, separate by a "."

Edit : corrected the /g and the ) that return the error.

Last edited by Wims; 19/01/08 06:10 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
Quote:
Too few parameters: $gettok

Last edited by foshizzle; 19/01/08 05:59 PM.

This is not the signature you are looking for
Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
I've edited my code


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
?


This is not the signature you are looking for
Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
Use the new code :
Code:
uclick:{
if ($hget($active)) { 
var %exid = $regsubex($str(a,$hget($v1,0).item),/a/g,$+($isclick($mouse.x,$mouse.y,$gettok($hget($v1,\n).data,2-6,32),\n),.))
echo -a > %exid
 }
}

alias isclick tokenize 32 $1- | return $iif($inrect($1,$2,$3,$4,$5,$6),$7)


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
thx, but how do u change what %exid says


This is not the signature you are looking for
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
and then we come up with

Code:
  mouse: { if ($hget($active)) {
      var %exid = $regsubex($str(a,$hget($v1,0).item),/a/g,$+($isclick($mouse.x,$mouse.y,$gettok($hget($v1,\n).data,2-6,32),\n),.))
      if (*... !iswm %exid) {
        gui.draw button @GUI 2 20 25 180 20 Close
      }
      var %exid = $regsubex($str(a,$hget($v1,0).item),/a/g,$+($isclick($mouse.x,$mouse.y,$gettok($hget($v1,\n).data,2-6,32),\n),.))
      if (*... iswm %exid) {
        tokenize 32 button $active 2 20 25 180 20 Close
        drawrect -frn $2 $rgb(247,242,255) 1 $4 $calc($5 + 25) $6 $7
        drawrect -frn $2 $rgb(224,220,250) 1 $calc($4 + 2) $calc($5 + 2 + 25) $calc($6 - 2) $calc($7 - 2)
        drawrect -rn $2 $rgb(191,186,195) 1 $4 $calc($5 + 25) $6 $7
        $iif($8, drawtext -rn $active $rgb(202,197,215) Verdana 12 $calc($4 + $6 / 2 - $width($8-,Verdana,12) / 2 + 1) $calc($5 + $7 / 2 - $height($8-,Verdana,12) / 2 + 1 + 25) $8-, )
        $iif($8, drawtext -rn $active $rgb(26,26,26) Verdana 12 $calc($4 + $6 / 2 - $width($8-,Verdana,12) / 2) $calc($5 + $7 / 2 - $height($8-,Verdana,12) / 2 + 25) $8-, )
        drawdot $active
      }
  } }
  sclick: { if ($hget($active) == $active) { 
      tokenize 32 button $active 2 20 25 180 20 Close
      if ($inrect($mouse.x,$mouse.y,20,55,180,20)) {
        drawrect -frn $active $rgb(202,197,215) 1 $4 $calc($5 + 25) $6 $7
        drawrect -frn $active $rgb(184,180,200) 1 $4 $calc($5 + 25) $calc($6 - 2) $calc($7 - 2)
        drawrect -rn $active $rgb(151,146,155) 1 $4 $calc($5 + 25) $6 $7
        $iif($8, drawtext -rn $active $rgb(202,197,215) Verdana 12 $calc($4 + $6 / 2 - $width($8-,Verdana,12) / 2 + 1) $calc($5 + $7 / 2 - $height($8-,Verdana,12) / 2 + 1 + 25) $8-, )
        $iif($8, drawtext -rn $active $rgb(26,26,26) Verdana 12 $calc($4 + $6 / 2 - $width($8-,Verdana,12) / 2) $calc($5 + $7 / 2 - $height($8-,Verdana,12) / 2 + 25) $8-, )
        drawdot $active
  } } }

how to fix that..


This is not the signature you are looking for
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
What's wrong with it and which part isn't working?

Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
What ? %exid return the id(s) you've clicked on
If %exid = 1.2.4, you've clicked on Id ($hget(table,Id)) 1, 2 and 4.

Last edited by Wims; 19/01/08 06:53 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
can u change the script i pasted so it works the way i specified below the mouse event and change it so it is the way i wanted


This is not the signature you are looking for
Joined: Jul 2006
Posts: 4,180
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,180
Code:
if (*... !iswm %exid) {
gui.draw button @GUI 2 20 25 180 20 Close
}
In which case this statement would be true ?
It's the same question for the second statement, %exid return the Nth item... Would you like that %exid return the type of id (button, or else) ?


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
OP Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
ive changed that to click...
but what would it say if i did a mouse event or a sclick


This is not the signature you are looking for
Page 2 of 3 1 2 3

Link Copied to Clipboard