mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Sep 2010
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Sep 2010
Posts: 9
hi , i have this script someone made for me a time ago ( still kinda noob in this )
at this site ( justin.tv ) users can log in with twitter , facebook or myspace accounts too

so when someone called "other_user" types a simple message like "123" , the ones using irc ( you can use the web page too in that site ) , we see this

Code:
[04:06:37] <externaluser-twitter-other_user> {"login":"other_user","image_url":"http://a2.twimg.com/profile_images/710545386/ojo1_normal.jpg","message":"123"}


so someone made me this script :

Code:
on ^*:text:*:*:if (*facebook* iswm $nick) || (*twitter* iswm $nick) || (*myspace* iswm $nick) { highlight $1- | haltdef }
on ^*:action:*:*:if (*facebook* iswm $nick) || (*twitter* iswm $nick) || (*myspace* iswm $nick) { highlight $1- | haltdef }
on ^*:notice:*:*:if (*facebook* iswm $nick) || (*twitter* iswm $nick) || (*myspace* iswm $nick) { highlight $1- | haltdef }
alias -l highlight {
  if ($regex($1-,/message\42\72\42(.*?)\42\b/iS)) { echo -bfilmrt $iif(#,#,$nick) $+(<,$nick(#,$nick).pnick,>) $mid($regml(1),1,-2) }
}


was working fine with the 6.35 version , now i noticed with the 7.1 version is not working , when one of these users types something , nothing it's displayed in mirc ... ( not even the username smirk


Joined: Sep 2010
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Sep 2010
Posts: 9
nobody ? , lol , i thought this could be the right forum to ask about mirc smile

Joined: Sep 2010
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Sep 2010
Posts: 9
bump

anyone ?

something of that piece of code should not work any new feature of mirc 7 ?

Joined: Aug 2004
Posts: 7,252
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
This is one place to ask about scripts, but looking at your code, there's nothing I see that would keep it from working on 7.x

Now my knowledge of regex is very limited, thus I can't rule out that your regex might be the problem.

On a side note, usually if no one answers a direct question, like yours, it's because no one can see the reason for the problem.

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Have you tested each part of this with /echo to figure out where it stops working?

Joined: Sep 2010
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Sep 2010
Posts: 9
what you call each part exactly (noob here)?
i tried removing all the echo parameters (-bfilmrt) , and then adding it back one by one to check if one of those was causing the trouble maybe not compatible with mirc 7 , but no , still not working , when a "external-user" types something i can't see any anything ...
guess the regex is always false
ooops , i see the format changed a bit , just the place of the message , but the format "message":"1234" is still the same , that could be causing the problem ?
i know just a bit of regex and i was trying to find the meaning of the 42 and 72 there , but those wasn't positions to start the search or anything i know

Code:
actual
[14:44:02] <externaluser-twitter-carlitosbahia> {"login":"carlitosbahia","image_url":"http://a0.twimg.com/profile_images/1135852196/felipe_de_mafalda_normal.gif","message":"example message"}


original
[03:35:14] <externaluser-twitter-other_user> {"message":"1234","login":"other_user","image_url":"http://a1.twimg.com/profile_images/710545386/ojo1_normal.jpg"} 


Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Yeah I haven't taken the time to fully learn regex so I can't help you there.

Put echo's in your alias. One echo in the beginning to see if the alias triggered. One echo after the regex check to see if the comparison became true. Then I will check the data of the echo line if the comparison works. You see I seperate the data so I can tell if one of them isn't working or returning incorrect data.

Also, for the best test, make sure there aren't any other scripts loaded, or be 100% sure they aren't conflicting with this script. And one more thing, if you have any text events in the same file but above these events, it won't trigger these events.
Code:
alias -l highlight {
echo -a Highlight: $1-

  if ($regex($1-,/message\42\72\42(.*?)\42\b/iS)) {
echo -a Highlight regex is true
echo -a $iif(#,#,$nick) :: $+(<,$nick(#,$nick).pnick,>) :: $mid($regml(1),1,-2)

echo -bfilmrt $iif(#,#,$nick) $+(<,$nick(#,$nick).pnick,>) $mid($regml(1),1,-2) }
}


So you think the script doesn't work because of the mirc version? Have you put just that script in a previous version of mirc to test that that is true?

Joined: Sep 2010
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Sep 2010
Posts: 9
ok , i get only this one in the status window , nothing in the channel one
so the $regex if , is failing ...

Code:
Highlight: {"login":"carlitosbahia","image_url":"http://a0.twimg.com/profile_images/1135852196/felipe_de_mafalda_normal.gif","message":"test123"}


not used again this in a older version yet , because this happened when i installed 7 , only change i made ( script is exactly the same , same server , channel , etc )


if i replace the regex with
if ($regex($1-,"message":"(.+)"))
almost works , but i only get some characters of the message ... frown

i have this now
Code:
on ^*:text:*:*:if (*facebook* iswm $nick) || (*twitter* iswm $nick) || (*myspace* iswm $nick) { highlight $1- | haltdef }
on ^*:action:*:*:if (*facebook* iswm $nick) || (*twitter* iswm $nick) || (*myspace* iswm $nick) { highlight $1- | haltdef }
on ^*:notice:*:*:if (*facebook* iswm $nick) || (*twitter* iswm $nick) || (*myspace* iswm $nick) { highlight $1- | haltdef }

alias -l highlight {
  if ($regex($1-,"message":"(.+)")) {
    echo -bfilmrt $iif(#,#,$nick) $+(<,$nick(#,$nick).pnick,>) $mid($regml(1),1,5)}
}



<externaluser-twitter-carlitosbahia> 98765
$mid($regml(1),1,5)} is my problem now ( that way i see the first 5 characters only ), if i use $len($regml(1)) , instead of the 5 , then an error messsage appears ,"Invalid format: $mid"

if i use -2 as before that removes the last 2 , using 0 i see the length no the message ...

Joined: Feb 2006
Posts: 181
C
Vogon poet
Offline
Vogon poet
C
Joined: Feb 2006
Posts: 181
Code:
alias -l highlight {
  if ($regex($1-,"message":"(.+)")) { echo -bfilmrt $iif(#,#,$nick) $+(<,$nick(#,$nick).pnick,>) $regml(1) }
}

OR:
Code:
alias -l highlight {
  if ($regex($1-,/message\42\72\42(.*?)\42/iS)) { echo -bfilmrt $iif(#,#,$nick) $+(<,$nick(#,$nick).pnick,>) $regml(1) }
}

Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
alias -l highlight {
if ($regex($1-,"message":"(.+)")) {
echo -bfilmrt $iif(#,#,$nick) $+(<,$nick(#,$nick).pnick,>) $mid($regml(1),1,5)}
}

There is no space between $regml and the closing bracket.

Joined: Sep 2010
Posts: 9
B
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
B
Joined: Sep 2010
Posts: 9
i type 123456789

with 1st
[19:50:00] <externaluser-twitter-carlitosbahia> 123456789","image_url":"http://a0.twimg.com/profile_images/1135852196/felipe_de_mafalda_normal.gif

with 2nd
123456789
WORKS !!!!!!!! , thanks smile

so was not the $regex ( well , works , i don't care how or why , lol )


Link Copied to Clipboard