Jump to content
Sign in to follow this  
emoyasha

check is a variable contains a string

Recommended Posts

emoyasha

i want to know if my variable $sText contains /NUDGE

so that way if $sText contains /NUDGE the script will play a nudge sound and activate the window

the nudge file is nudge.wma although i know how too do this and ow too implement win activate

i just need to know how to see if the variable contains /NUDGE and if it dose to preform an action thanks...


Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Share this post


Link to post
Share on other sites
BrettF

God. Ever heard of the word 'if' and 'helpfile'???

If $sText = '/Nudge' Then
    ; Do something
ElseIf $sText = '/Something Else' Then
    ; Do something else
EndifoÝ÷ Ù8^¢Ø^®mâ²Ú.±ç¢¶«i'¥yËh®Ì"µÈlµ«^éíIé^rÖ®¶­se6VÆV7@ 66Rb33c·5FWBÒb33²ôçVFvRb33° ²7Föà 66Rb33c·5FWBÒb33²ôÄôÂb33° ²æ÷FW"7Föà¤VæE6VÆV7@oÝ÷ Ù,"µÈZºÚ"µÍÝÚ]Ú  ÌÍÜÕ^PØÙH ÌÎNËÓYÙIÌÎNÂBNÈÈÛÛY][ËPØÙH   ÌÎNËÔÕ ÌÎNÂBNÈÛÛY][È[ÙB[ÝÚ]Ú

Share this post


Link to post
Share on other sites
BrettF

And I can't edit without having screwed code. Must ask if I can have a look at that some time... :D

GUICreate ("", 200, 200)
GUISetState (@SW_SHOW)

Sleep (1000)

GUISetState (@SW_MINIMIZE)

Sleep (1000)

GUISetState (@SW_RESTORE)

Sleep (1000)oÝ÷ Ù«­¢+ÙM½Õ¹A±ä¡]¥¹½ÝͥȵÀìÅÕ½ÐìÀäÈíµ¥ÀäÈíѹÝØÅÕ½Ðì°Ä¤

Cheers,

Bert

Share this post


Link to post
Share on other sites
emoyasha

thanks, i prefer to use soundplay lol ,, shorter


Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Share this post


Link to post
Share on other sites
slayerz

$sText = "any string in this variable, also contains /NUDGE here"
$check = StringInStr($sText , "/NUDGE")
If @error = 0 Then
SoundPlay("nudge.wma")
Else
; if u have certains action
EndIf

8)

Edited by slayerz

AUTOIT[sup] I'm lovin' it![/sup]

Share this post


Link to post
Share on other sites
slayerz

BTW, the above example is to check whether your variable does contains string "/NUDGE",

if the returned value is 0 means the string exist in that variable. hope that help u lil bit :D


AUTOIT[sup] I'm lovin' it![/sup]

Share this post


Link to post
Share on other sites
BrettF

StrInStr should probably not be used in his MSN cliet, as it would most likely be sent just as /Nudge right? if a normal messenger sends /Nudge, you can't send it in text. Only with the button. Mmmmmmm?

Share this post


Link to post
Share on other sites
emoyasha

yes yes. but im learning from this first and thanks it was necesary because the variable contains html format tags....


Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Share this post


Link to post
Share on other sites
emoyasha

hmm dosent seem too work. im going to bed but i tryed all the code, only the StrInStr even let the nudge come up at all, because of the html format. however every time u sent a message it counted it as a nudge i dunno why, well im going to bed, ill be on here to look tmrw


Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Share this post


Link to post
Share on other sites
slayerz

hmm dosent seem too work. im going to bed but i tryed all the code, only the StrInStr even let the nudge come up at all, because of the html format. however every time u sent a message it counted it as a nudge i dunno why, well im going to bed, ill be on here to look tmrw

which 1 doesn't work?


AUTOIT[sup] I'm lovin' it![/sup]

Share this post


Link to post
Share on other sites
BrettF
emoyasha

so how would implement that if the varibale containg it is $stext and i want it to preform an action if it dose


Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Share this post


Link to post
Share on other sites
BrettF

so how would implement that if the varibale containg it is $stext and i want it to preform an action if it dose

Replace '/Nudge' in all my examples with StringInStr ($sText......)

Share this post


Link to post
Share on other sites
therks
$sText = "any string in this variable, also contains /NUDGE here"
$check = StringInStr($sText , "/NUDGE")
If @error = 0 Then
SoundPlay("nudge.wma")
Else
; if u have certains action
EndIfoÝ÷ ÛÏêº^JëÉ»­¶­Ì+¢x®º+Â)ejÊÆÞÒ)í«^Å©©ê®¢×®º+ÐÚ+©h¥êÚ¶*'Ö#rêëzwþ,³Crêëzwë-m橢ȭ÷¨®w jدz)íz«þ«¨µèqË«­éÜ{ø¡z·«y÷«²Ú)j¶¦z׫â)íçîËb¢tázè¥êæzØhw*.j·¥¢"è®)ò¢êìr¸©¶+,¹ÈZºÚ"µÍÌÍÜÕ^H ][ÝØ[HÝ[È[ÈXXK[ÛÈÛÛZ[ÈÓQÑHI][ÝÂÌÍØÚXÚÈHÝ[Ò[Ý ÌÍÜÕ^   ][ÝËÓQÑI][ÝÊBY    ÌÍØÚXÚÈ[ÛÝ[^J   ][ÝÛYÙKÛXI][ÝÊB[ÙBÈYH]HÙZ[ÈXÝ[Û[Y

Share this post


Link to post
Share on other sites
emoyasha

thanks, i gope i works, ill do some testing once i get home.


Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Share this post


Link to post
Share on other sites
emoyasha

works like a charm.


Spoiler

Admin Of:http://notmyspace.info [Under Development, looking for volunteers to help improve]http://PSNetCards.co.ukhttp://ZacnAndLindsey.com [Under development, not quite sure what to do with it yet]http://revelm.com------------------------------------Radio Streams:http://75.185.53.88:8000 [128kb/s 44kHz]http://75.185.53.88:8002 [22kb/s 22kHz](works on mobile phones)-----------------------------------My Server:Owned By: http://jumpline.comIP:66.84.19.220Bandwidth:200GBStorage Space:1TBNetwork Connection: 1GB/S[up and down]Operating System: Red Hat LinuxInstalled Apps:Webmail, phpBB, Majordomo, phpMyAdmin, MySQL, Active Server Pages, FrontPage Extensions 2002, GraphicsMagick, Mod Perl, Perl, PHP: Hypertext Preprocessor, Python(want cheap good webhosting, or need a place to park your domain? contact me)-----------------------------------

 

Share this post


Link to post
Share on other sites
slayerz

really? glad 2hear that... :D


AUTOIT[sup] I'm lovin' it![/sup]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×