mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 3 1 2 3
Re: getting name of window using a hash table with [Re: qwerty] #193267 17/01/08 08:05 PM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
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
Re: getting name of window using a hash table with [Re: qwerty] #193285 17/01/08 11:05 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
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
Re: getting name of window using a hash table with [Re: foshizzle] #193375 19/01/08 12:27 AM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
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
Re: getting name of window using a hash table with [Re: foshizzle] #193376 19/01/08 12:34 AM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
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.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: getting name of window using a hash table with [Re: Wims] #193378 19/01/08 02:38 AM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
thx


This is not the signature you are looking for
Re: getting name of window using a hash table with [Re: foshizzle] #193381 19/01/08 02:57 AM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
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
Re: getting name of window using a hash table with [Re: foshizzle] #193402 19/01/08 01:48 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
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


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: getting name of window using a hash table with [Re: Wims] #193415 19/01/08 05:06 PM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
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
Re: getting name of window using a hash table with [Re: foshizzle] #193420 19/01/08 05:43 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
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.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: getting name of window using a hash table with [Re: Wims] #193423 19/01/08 05:53 PM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
Quote:
Too few parameters: $gettok

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

This is not the signature you are looking for
Re: getting name of window using a hash table with [Re: foshizzle] #193428 19/01/08 06:10 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
I've edited my code


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: getting name of window using a hash table with [Re: Wims] #193429 19/01/08 06:16 PM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
?


This is not the signature you are looking for
Re: getting name of window using a hash table with [Re: foshizzle] #193431 19/01/08 06:21 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
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)


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: getting name of window using a hash table with [Re: Wims] #193436 19/01/08 06:35 PM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
thx, but how do u change what %exid says


This is not the signature you are looking for
Re: getting name of window using a hash table with [Re: foshizzle] #193438 19/01/08 06:39 PM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
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
Re: getting name of window using a hash table with [Re: foshizzle] #193440 19/01/08 06:40 PM
Joined: Sep 2005
Posts: 2,878
H
hixxy Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,878
What's wrong with it and which part isn't working?

Re: getting name of window using a hash table with [Re: foshizzle] #193443 19/01/08 06:52 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
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.

Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: getting name of window using a hash table with [Re: Wims] #193449 19/01/08 07:07 PM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
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
Re: getting name of window using a hash table with [Re: foshizzle] #193465 19/01/08 07:52 PM
Joined: Jul 2006
Posts: 3,623
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,623
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) ?


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: getting name of window using a hash table with [Re: Wims] #193479 19/01/08 09:11 PM
Joined: Aug 2007
Posts: 333
foshizzle Offline OP
Fjord artisan
OP Offline
Fjord artisan
Joined: Aug 2007
Posts: 333
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