Phantomass Posted June 7, 2008 Share Posted June 7, 2008 (edited) Hello again. I created its script and now want to do support Tray. add Code: Opt("TrayMenuMode",1) $trseti = TrayCreateItem("Settings") $delitem = TrayCreateItem("Restart") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $trseti Msgbox(64,"ProgName","Settings...") Case $msg = $aboutitem Msgbox(64,"ProgName","About...") Case $msg = $delitem $path=@ScriptFullPath run($path) exit Case $msg = $exititem Exit ExitLoop EndSelect WEnd Was it In total got: Opt("TrayMenuMode",1) $trseti = TrayCreateItem("Settings") $delitem = TrayCreateItem("Restart") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $trseti Msgbox(64,"ProgName","Settings...") Case $msg = $aboutitem Msgbox(64,"ProgName","About...") Case $msg = $delitem $path=@ScriptFullPath run($path) exit Case $msg = $exititem Exit ExitLoop EndSelect WEnd *MY CODE HERE* Ok, tray appeared and works, BUT code does not work! Why? Where add the code tray that all worked? Help plz... Edited June 7, 2008 by Phantomass Link to comment Share on other sites More sharing options...
d3mon Posted June 7, 2008 Share Posted June 7, 2008 Can you write your code for know why it doesn't work , thx No-life of autoit...what could be better ?LAST SCRIPTS WITH AUTO-IT : CLICK HERE Link to comment Share on other sites More sharing options...
Phantomass Posted June 7, 2008 Author Share Posted June 7, 2008 ok, my code: expandcollapse popupHotKeySet("!{F1}", "proext") HotKeySet("!{F2}", "prorest") WinWaitActive("Counter-Strike") HotKeySet("y", "pron") HotKeySet("u", "pronu") HotKeySet("`", "pronc") WinWaitClose("Counter-Strike") $path=@ScriptFullPath run($path) exit Func pronc() HotKeySet("`") HotKeySet("y") HotKeySet("u") HotKeySet("{ENTER}", "prexfu") HotKeySet("{Esc}", "prexe") Send("`") HotKeySet("`", "prexecon") EndFunc Func prorest() $path=@ScriptFullPath run($path) exit EndFunc Func proext() exit EndFunc Func prexeee() HotKeySet("`") Send("`") HotKeySet("y", "pron") HotKeySet("u", "pronu") HotKeySet("`", "pronc") $path=@ScriptFullPath run($path) exit EndFunc Func prexfu() HotKeySet("y") HotKeySet("u") HotKeySet("`") HotKeySet("{ENTER}") Send("{ENTER}") HotKeySet("{ENTER}", "prexfu") HotKeySet("`", "prexeee") HotKeySet("{Esc}", "prexe") EndFunc Func prex() HotKeySet("{ENTER}") Send("{ENTER}") HotKeySet("{ENTER}", "prex") HotKeySet("y") HotKeySet("u") HotKeySet("`", "pronc") $path=@ScriptFullPath run($path) exit EndFunc Func prexecon() HotKeySet("`") Send("`") HotKeySet("`", "prexecon") HotKeySet("y", "pron") HotKeySet("u", "pronu") $path=@ScriptFullPath run($path) exit EndFunc Func prexe() HotKeySet("{Esc}") Send("{Esc}") HotKeySet("{Esc}", "prexe") HotKeySet("y", "pron") HotKeySet("u", "pronu") HotKeySet("`", "pronc") $path=@ScriptFullPath run($path) exit EndFunc Func pron() HotKeySet("y") HotKeySet("+7", "bvop") HotKeySet("q", "bq") HotKeySet("w", "bw") HotKeySet("e", "be") HotKeySet("r", "br") HotKeySet("t", "bt") HotKeySet("u", "bu") HotKeySet("i", "bi") HotKeySet("o", "bo") HotKeySet("p", "bp") HotKeySet("[", "bn1") HotKeySet("]", "bn2") HotKeySet("a", "ba") HotKeySet("s", "bs") HotKeySet("d", "bd") HotKeySet("f", "bf") HotKeySet("g", "bg") HotKeySet("h", "bh") HotKeySet("j", "bj") HotKeySet("k", "bk") HotKeySet("l", "bl") HotKeySet(";", "bddd") HotKeySet("'", "bqu") HotKeySet("z", "bz") HotKeySet("x", "bx") HotKeySet("v", "bv") HotKeySet("b", "bb") HotKeySet("n", "bn") HotKeySet("m", "bm") HotKeySet(",", "bts") HotKeySet(".", "bto") HotKeySet("/", "tild") HotKeySet("{ENTER}", "prex") HotKeySet("{Esc}", "prexe") Send("y") HotKeySet("y", "by") EndFunc Func pronu() HotKeySet("u") HotKeySet("+7", "bvop") HotKeySet("q", "bq") HotKeySet("w", "bw") HotKeySet("e", "be") HotKeySet("r", "br") HotKeySet("t", "bt") HotKeySet("y", "by") HotKeySet("i", "bi") HotKeySet("o", "bo") HotKeySet("p", "bp") HotKeySet("[", "bn1") HotKeySet("]", "bn2") HotKeySet("a", "ba") HotKeySet("s", "bs") HotKeySet("d", "bd") HotKeySet("f", "bf") HotKeySet("g", "bg") HotKeySet("h", "bh") HotKeySet("j", "bj") HotKeySet("k", "bk") HotKeySet("l", "bl") HotKeySet(";", "bddd") HotKeySet("'", "bqu") HotKeySet("z", "bz") HotKeySet("x", "bx") HotKeySet("v", "bv") HotKeySet("b", "bb") HotKeySet("n", "bn") HotKeySet("m", "bm") HotKeySet(",", "bts") HotKeySet(".", "bto") HotKeySet("/", "tild") HotKeySet("{ENTER}", "prex") HotKeySet("{Esc}", "prexe") Send("u") HotKeySet("u", "bu") EndFunc While 1 Sleep(100) WEnd Func bvop() HotKeySet("7") Send("?") HotKeySet("7", "bvop") EndFunc Func bq() HotKeySet("u") HotKeySet("*") Send("u*") HotKeySet("u", "bu") HotKeySet("*") EndFunc Func bw() HotKeySet("u") HotKeySet(",") Send("u,") HotKeySet("u", "bu") HotKeySet(",") EndFunc Func be() HotKeySet("y") Send("y") HotKeySet("y", "by") EndFunc Func br() HotKeySet("k") Send("K") HotKeySet("k", "bk") EndFunc Func bt() HotKeySet("e") Send("E") HotKeySet("e", "be") EndFunc Func by() HotKeySet("h") Send("H") HotKeySet("h", "bh") EndFunc Func bu() HotKeySet("r") Send("r") HotKeySet("r", "br") EndFunc Func bi() HotKeySet("L") HotKeySet("I") Send("LLI") HotKeySet("L", "bl") HotKeySet("I", "bi") EndFunc Func bo() HotKeySet("L") HotKeySet("|") Send("LL|") HotKeySet("L", "bl") HotKeySet("|") EndFunc Func bp() Send("3") EndFunc Func bn1() HotKeySet("X") Send("X") HotKeySet("X", "bx") EndFunc Func bn2() HotKeySet("b") Send("b") HotKeySet("b", "bb") EndFunc Func ba() HotKeySet("q") HotKeySet("p") Send("qp") HotKeySet("q", "bq") HotKeySet("p", "bp") EndFunc Func bs() HotKeySet("b") HotKeySet("I") Send("bI") HotKeySet("b", "bb") HotKeySet("I", "bi") EndFunc Func bd() HotKeySet("b") Send("B") HotKeySet("b", "bb") EndFunc Func bf() HotKeySet("a") Send("A") HotKeySet("a", "ba") EndFunc Func bg() HotKeySet("n") Send("n") HotKeySet("n", "bn") EndFunc Func bh() HotKeySet("P") Send("P") HotKeySet("P", "bp") EndFunc Func bj() HotKeySet("o") Send("O") HotKeySet("o", "bo") EndFunc Func bk() HotKeySet("J") HotKeySet("I") Send("JI") HotKeySet("J", "bj") HotKeySet("I", "bi") EndFunc Func bl() HotKeySet("g") Send("g") HotKeySet("g", "bg") EndFunc Func bddd() HotKeySet("{") HotKeySet("|") HotKeySet("}") Send("}|{") HotKeySet("{", "bn1") HotKeySet("}", "bn2") EndFunc Func bqu() HotKeySet("-") HotKeySet(")") Send("-)") HotKeySet("-") HotKeySet(")") EndFunc Func bz() HotKeySet("9") Send("9") HotKeySet("9", "bz") EndFunc Func bx() HotKeySet("4") Send("4") HotKeySet("4") EndFunc Func bv() HotKeySet("m") Send("M") HotKeySet("m", "bm") EndFunc Func bb() HotKeySet("u") Send("u") HotKeySet("u", "bu") EndFunc Func bn() HotKeySet("t") Send("T") HotKeySet("t", "bt") EndFunc Func bm() HotKeySet("b") Send("b") HotKeySet("b", "bb") EndFunc Func bto() HotKeySet("|") HotKeySet("-") HotKeySet("0") Send("|-0") HotKeySet("|") HotKeySet("-") HotKeySet("0") EndFunc Func tild() HotKeySet(".") Send(".") HotKeySet(".", "bto") EndFunc Func bts() HotKeySet("6") Send("6") HotKeySet("6") EndFunc Link to comment Share on other sites More sharing options...
martin Posted June 7, 2008 Share Posted June 7, 2008 Your While 1/wend where you have the traymenu will loop forever and so you never get to the rest of the code. You need to rearrange things so that the hotkeys are set before the loop. It seems a bit extreme to exit the script after starting another copy of it instead of starting again. I think this should do what you want. expandcollapse popupHotKeySet("!{F1}", "proext") HotKeySet("!{F2}", "prorest") HotKeySet("y", "pron") HotKeySet("u", "pronu") HotKeySet("`", "pronc") Opt("TrayMenuMode", 1) $trseti = TrayCreateItem("Settings") $delitem = TrayCreateItem("Restart") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() Global $reloop While 1 WinWaitActive("Counter-Strike") $reloop = False While WinExists("Counter-Strike") If $reloop Then ExitLoop $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $trseti MsgBox(64, "ProgName", "Settings...") Case $msg = $aboutitem MsgBox(64, "ProgName", "About...") Case $msg = $delitem $path = @ScriptFullPath Run($path) Exit Case $msg = $exititem Exit ExitLoop EndSelect WEnd WEnd Func pronc() HotKeySet("`") HotKeySet("y") HotKeySet("u") HotKeySet("{ENTER}", "prexfu") HotKeySet("{Esc}", "prexe") Send("`") HotKeySet("`", "prexecon") EndFunc ;==>pronc Func prorest() ;$path = @ScriptFullPath ;Run($path) ;Exit $reloop = True EndFunc ;==>prorest Func proext() Exit EndFunc ;==>proext Func prexeee() HotKeySet("`") Send("`") HotKeySet("y", "pron") HotKeySet("u", "pronu") HotKeySet("`", "pronc") ;$path = @ScriptFullPath ;Run($path) ;Exit $reloop = True EndFunc ;==>prexeee Func prexfu() HotKeySet("y") HotKeySet("u") HotKeySet("`") HotKeySet("{ENTER}") Send("{ENTER}") HotKeySet("{ENTER}", "prexfu") HotKeySet("`", "prexeee") HotKeySet("{Esc}", "prexe") EndFunc ;==>prexfu Func prex() HotKeySet("{ENTER}") Send("{ENTER}") HotKeySet("{ENTER}", "prex") HotKeySet("y") HotKeySet("u") HotKeySet("`", "pronc") ;$path = @ScriptFullPath ;Run($path) ;Exit $reloop = True EndFunc ;==>prex Func prexecon() HotKeySet("`") Send("`") HotKeySet("`", "prexecon") HotKeySet("y", "pron") HotKeySet("u", "pronu") ;$path = @ScriptFullPath ;Run($path) ;Exit $reloop = True EndFunc ;==>prexecon Func prexe() HotKeySet("{Esc}") Send("{Esc}") HotKeySet("{Esc}", "prexe") HotKeySet("y", "pron") HotKeySet("u", "pronu") HotKeySet("`", "pronc") ;$path = @ScriptFullPath ;Run($path) ;Exit $reloop = True EndFunc ;==>prexe Func pron() HotKeySet("y") HotKeySet("+7", "bvop") HotKeySet("q", "bq") HotKeySet("w", "bw") HotKeySet("e", "be") HotKeySet("r", "br") HotKeySet("t", "bt") HotKeySet("u", "bu") HotKeySet("i", "bi") HotKeySet("o", "bo") HotKeySet("p", "bp") HotKeySet("[", "bn1") HotKeySet("]", "bn2") HotKeySet("a", "ba") HotKeySet("s", "bs") HotKeySet("d", "bd") HotKeySet("f", "bf") HotKeySet("g", "bg") HotKeySet("h", "bh") HotKeySet("j", "bj") HotKeySet("k", "bk") HotKeySet("l", "bl") HotKeySet(";", "bddd") HotKeySet("'", "bqu") HotKeySet("z", "bz") HotKeySet("x", "bx") HotKeySet("v", "bv") HotKeySet("b", "bb") HotKeySet("n", "bn") HotKeySet("m", "bm") HotKeySet(",", "bts") HotKeySet(".", "bto") HotKeySet("/", "tild") HotKeySet("{ENTER}", "prex") HotKeySet("{Esc}", "prexe") Send("y") HotKeySet("y", "by") EndFunc ;==>pron Func pronu() HotKeySet("u") HotKeySet("+7", "bvop") HotKeySet("q", "bq") HotKeySet("w", "bw") HotKeySet("e", "be") HotKeySet("r", "br") HotKeySet("t", "bt") HotKeySet("y", "by") HotKeySet("i", "bi") HotKeySet("o", "bo") HotKeySet("p", "bp") HotKeySet("[", "bn1") HotKeySet("]", "bn2") HotKeySet("a", "ba") HotKeySet("s", "bs") HotKeySet("d", "bd") HotKeySet("f", "bf") HotKeySet("g", "bg") HotKeySet("h", "bh") HotKeySet("j", "bj") HotKeySet("k", "bk") HotKeySet("l", "bl") HotKeySet(";", "bddd") HotKeySet("'", "bqu") HotKeySet("z", "bz") HotKeySet("x", "bx") HotKeySet("v", "bv") HotKeySet("b", "bb") HotKeySet("n", "bn") HotKeySet("m", "bm") HotKeySet(",", "bts") HotKeySet(".", "bto") HotKeySet("/", "tild") HotKeySet("{ENTER}", "prex") HotKeySet("{Esc}", "prexe") Send("u") HotKeySet("u", "bu") EndFunc ;==>pronu Func bvop() HotKeySet("7") Send("?") HotKeySet("7", "bvop") EndFunc ;==>bvop Func bq() HotKeySet("u") HotKeySet("*") Send("u*") HotKeySet("u", "bu") HotKeySet("*") EndFunc ;==>bq Func bw() HotKeySet("u") HotKeySet(",") Send("u,") HotKeySet("u", "bu") HotKeySet(",") EndFunc ;==>bw Func be() HotKeySet("y") Send("y") HotKeySet("y", "by") EndFunc ;==>be Func br() HotKeySet("k") Send("K") HotKeySet("k", "bk") EndFunc ;==>br Func bt() HotKeySet("e") Send("E") HotKeySet("e", "be") EndFunc ;==>bt Func by() HotKeySet("h") Send("H") HotKeySet("h", "bh") EndFunc ;==>by Func bu() HotKeySet("r") Send("r") HotKeySet("r", "br") EndFunc ;==>bu Func bi() HotKeySet("L") HotKeySet("I") Send("LLI") HotKeySet("L", "bl") HotKeySet("I", "bi") EndFunc ;==>bi Func bo() HotKeySet("L") HotKeySet("|") Send("LL|") HotKeySet("L", "bl") HotKeySet("|") EndFunc ;==>bo Func bp() Send("3") EndFunc ;==>bp Func bn1() HotKeySet("X") Send("X") HotKeySet("X", "bx") EndFunc ;==>bn1 Func bn2() HotKeySet("b") Send("b") HotKeySet("b", "bb") EndFunc ;==>bn2 Func ba() HotKeySet("q") HotKeySet("p") Send("qp") HotKeySet("q", "bq") HotKeySet("p", "bp") EndFunc ;==>ba Func bs() HotKeySet("b") HotKeySet("I") Send("bI") HotKeySet("b", "bb") HotKeySet("I", "bi") EndFunc ;==>bs Func bd() HotKeySet("b") Send("B") HotKeySet("b", "bb") EndFunc ;==>bd Func bf() HotKeySet("a") Send("A") HotKeySet("a", "ba") EndFunc ;==>bf Func bg() HotKeySet("n") Send("n") HotKeySet("n", "bn") EndFunc ;==>bg Func bh() HotKeySet("P") Send("P") HotKeySet("P", "bp") EndFunc ;==>bh Func bj() HotKeySet("o") Send("O") HotKeySet("o", "bo") EndFunc ;==>bj Func bk() HotKeySet("J") HotKeySet("I") Send("JI") HotKeySet("J", "bj") HotKeySet("I", "bi") EndFunc ;==>bk Func bl() HotKeySet("g") Send("g") HotKeySet("g", "bg") EndFunc ;==>bl Func bddd() HotKeySet("{") HotKeySet("|") HotKeySet("}") Send("}|{") HotKeySet("{", "bn1") HotKeySet("}", "bn2") EndFunc ;==>bddd Func bqu() HotKeySet("-") HotKeySet(")") Send("-)") HotKeySet("-") HotKeySet(")") EndFunc ;==>bqu Func bz() HotKeySet("9") Send("9") HotKeySet("9", "bz") EndFunc ;==>bz Func bx() HotKeySet("4") Send("4") HotKeySet("4") EndFunc ;==>bx Func bv() HotKeySet("m") Send("M") HotKeySet("m", "bm") EndFunc ;==>bv Func bb() HotKeySet("u") Send("u") HotKeySet("u", "bu") EndFunc ;==>bb Func bn() HotKeySet("t") Send("T") HotKeySet("t", "bt") EndFunc ;==>bn Func bm() HotKeySet("b") Send("b") HotKeySet("b", "bb") EndFunc ;==>bm Func bto() HotKeySet("|") HotKeySet("-") HotKeySet("0") Send("|-0") HotKeySet("|") HotKeySet("-") HotKeySet("0") EndFunc ;==>bto Func tild() HotKeySet(".") Send(".") HotKeySet(".", "bto") EndFunc ;==>tild Func bts() HotKeySet("6") Send("6") HotKeySet("6") EndFunc ;==>bts Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
GEOSoft Posted June 7, 2008 Share Posted June 7, 2008 (edited) Hello again. I created its script and now want to do support Tray. add Code: Opt("TrayMenuMode",1) $trseti = TrayCreateItem("Settings") $delitem = TrayCreateItem("Restart") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $trseti Msgbox(64,"ProgName","Settings...") Case $msg = $aboutitem Msgbox(64,"ProgName","About...") Case $msg = $delitem $path=@ScriptFullPath run($path) exit Case $msg = $exititem Exit ExitLoop EndSelect WEnd Was it In total got: Opt("TrayMenuMode",1) $trseti = TrayCreateItem("Settings") $delitem = TrayCreateItem("Restart") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $trseti Msgbox(64,"ProgName","Settings...") Case $msg = $aboutitem Msgbox(64,"ProgName","About...") Case $msg = $delitem $path=@ScriptFullPath run($path) exit Case $msg = $exititem Exit ExitLoop EndSelect WEnd *MY CODE HERE* Ok, tray appeared and works, BUT code does not work! Why? Where add the code tray that all worked? Help plz...The way I see it only your $aboutitem and $trseti stand a chance of working. The others are wrong. $delitem should work if the script is compiled. Try this. Opt("TrayMenuMode",1) $trseti = TrayCreateItem("Settings") $delitem = TrayCreateItem("Restart") TrayCreateItem("") $aboutitem = TrayCreateItem("About") TrayCreateItem("") $exititem = TrayCreateItem("Exit") TraySetState() While 1 $msg = TrayGetMsg() Select Case $msg = 0 ContinueLoop Case $msg = $trseti Msgbox(64,"ProgName","Settings...") Case $msg = $aboutitem Msgbox(64,"ProgName","About...") Case $msg = $delitem $path=@ScriptFullPath run($path) exit Case $msg = $exititem Exit ExitLoop EndSelect WEnd Having Exit and ExitLoop in the same Case does you no good at all. Edited June 7, 2008 by GEOSoft George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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