Kyler Carlson Posted August 10, 2006 Share Posted August 10, 2006 (edited) ok. i'm trying to use AIM (AOL Instant Messanger) to mess around a little bit with my friend's computers. i can kindof get this to work but it isn't doing what I want it to. I basically plan on sending commands in the format "Command: (wat i want to happen)". how can i get it so that it will only do the command when i tell it to though and not keep doing it over and over but have the ability to do it again if i tell it to. While 1 $text = WinGetText("", "") If StringInStr($text ,"Command: Hello") Then Send("Hello {enter}") EndIf WEnd thats basically what I have been using but its promitive and will probabally need to be rewritten. thanks. Edit: yes I know there are other programs that are ment to to do this but I only have use for one that will work with AIM Edited August 10, 2006 by Kyler Carlson Link to comment Share on other sites More sharing options...
Kyler Carlson Posted August 10, 2006 Author Share Posted August 10, 2006 ok... i made this function to help solve the repeating problem Func occurance($name) $text = WinGetText("", "") $number = 1 $stop = 0 Do If not StringInStr($text ,"Command: Hello",0,$number) Then $stop = 1 $number = $number + 1 Until $stop = 1 $name = $number - 2 MsgBox(0,"",$name) EndFunc how can i launch the function though and have $name be the name of a variable. To clarify... I would do occurance($hello) and it would set $hello to the number of times the text is found. thanks. Link to comment Share on other sites More sharing options...
X-sploiT Posted August 10, 2006 Share Posted August 10, 2006 (edited) if you just want to say Command:Hello..if you just want Hello use the split function if there is one ,i dont know if auto it had Split or Mid i just know they have it in vb Edited August 10, 2006 by X-sploiT Link to comment Share on other sites More sharing options...
Golbez Posted August 10, 2006 Share Posted August 10, 2006 question. are you sending the commands to them over aim or like is it when they type stuff? and if u want ill help you code this it sounds like it would be fun and id love to do it to my friends also Link to comment Share on other sites More sharing options...
Kyler Carlson Posted August 10, 2006 Author Share Posted August 10, 2006 (edited) if you just want to say Command:Hello..if you just want Hello use the split function if there is one ,i dont know if auto it had Split or Mid i just know they have it in vbUm... I haven't heard of that but it could possibly be in autoit somewhere. I'm kindof confused by what it is supposed to do though. The "Hello" is just an example. I eventually might want to open his cd tray or open up notpad and type a message. Really... anything I feel like programing.question.are you sending the commands to them over aim or like is it when they type stuff?and if u want ill help you code this it sounds like it would be fun and id love to do it to my friends also i'm sending the commands via an aim window. Its kindof funny. With my prototye and only partially working version, I send it to my friend and i has it do certian things like when i said "Kyler(my name) wants you to open your cd tray" it would open. It was pretty cool. We both got a good laugh.Edit: fixed the second quoteEdit 2: fixed the second quopte... again Edited August 10, 2006 by Kyler Carlson Link to comment Share on other sites More sharing options...
Kyler Carlson Posted August 12, 2006 Author Share Posted August 12, 2006 I kindof didn't want to bump this but is there any help out there for my second post or anyway to have the occurance function work for several phrases without copying it like 20 times? I still haven't managed to fix it. Help would be greatly appreciated. Link to comment Share on other sites More sharing options...
Richard Robertson Posted August 12, 2006 Share Posted August 12, 2006 You will need a lot of If statements. Check out StringSplit. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now