Jabberwock Posted July 10, 2006 Share Posted July 10, 2006 i'm trying to get the quotes just right so that it sends the information and sends the full thing this will send the 1st word only #include <GuiConstants.au3> #include <Process.au3> GuiCreate("Search Allakhazam.com", 273, 125,-1, -1) $mob_input = GuiCtrlCreateInput("", 20, 30, 130, 20) $mob_button = GuiCtrlCreateButton("Go", 160, 30, 90, 20) $item_input = GuiCtrlCreateInput("", 20, 80, 130, 20) $item_button = GuiCtrlCreateButton("Go", 160, 80, 90, 20) $find_mob = GuiCtrlCreateGroup("Find Mob", 10, 10, 250, 50) $find_item = GuiCtrlCreateGroup("Find Item", 10, 60, 250, 50) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $mob_button $data = GUICtrlRead($mob_input) $rc = _RunDos("start http://eqbeastiary.allakhazam.com/search.shtml?name=" & $data) Case $msg = $item_button $data2 = GUICtrlRead($item_input) $rc = _RunDos("start http://everquest.allakhazam.com/db/searchdb.html?iname=" & $data2) Case Else ;;; EndSelect WEnd Exit and this seems to send nothing? #include <GuiConstants.au3> #include <Process.au3> GuiCreate("Search Allakhazam.com", 273, 125,-1, -1) $mob_input = GuiCtrlCreateInput("", 20, 30, 130, 20) $mob_button = GuiCtrlCreateButton("Go", 160, 30, 90, 20) $item_input = GuiCtrlCreateInput("", 20, 80, 130, 20) $item_button = GuiCtrlCreateButton("Go", 160, 80, 90, 20) $find_mob = GuiCtrlCreateGroup("Find Mob", 10, 10, 250, 50) $find_item = GuiCtrlCreateGroup("Find Item", 10, 60, 250, 50) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $mob_button $data = GUICtrlRead($mob_input) $rc = _RunDos("start http://eqbeastiary.allakhazam.com/search.shtml?name=" & ' $data ') Case $msg = $item_button $data2 = GUICtrlRead($item_input) $rc = _RunDos("start http://everquest.allakhazam.com/db/searchdb.html?iname=" & ' $data2 ') Case Else ;;; EndSelect WEnd Exit Link to comment Share on other sites More sharing options...
evilertoaster Posted July 10, 2006 Share Posted July 10, 2006 (edited) Try- #include <GuiConstants.au3> #include <Process.au3> GuiCreate("Search Allakhazam.com", 273, 125,-1, -1) $mob_input = GuiCtrlCreateInput("", 20, 30, 130, 20) $mob_button = GuiCtrlCreateButton("Go", 160, 30, 90, 20) $item_input = GuiCtrlCreateInput("", 20, 80, 130, 20) $item_button = GuiCtrlCreateButton("Go", 160, 80, 90, 20) GuiCtrlCreateGroup("Find Mob", 10, 10, 250, 50) GuiCtrlCreateGroup("Find Item", 10, 60, 250, 50) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $mob_button $data=StringReplace(GUICtrlRead($mob_input)," ","+") $rc = _RunDos("start http://eqbeastiary.allakhazam.com/search.shtml?name=" & $data) Case $msg = $item_button $data2 = StringReplace(GUICtrlRead($item_input)," ","+") $rc = _RunDos("start http://everquest.allakhazam.com/db/searchdb.html?iname=" & $data2) Case Else ;;; EndSelect WEnd Exit This search engine uses "+" for spaces (no spaces allowed in URLs) Edited July 10, 2006 by evilertoaster Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted July 10, 2006 Moderators Share Posted July 10, 2006 (edited) I would prefer this method personally:expandcollapse popup#include <GuiConstants.au3> $MainGUI = GuiCreate("Search Allakhazam.com", 273, 125,-1, -1) $mob_input = GuiCtrlCreateInput("", 20, 30, 130, 20) $mob_button = GuiCtrlCreateButton("Go", 160, 30, 90, 20) $item_input = GuiCtrlCreateInput("", 20, 80, 130, 20) $item_button = GuiCtrlCreateButton("Go", 160, 80, 90, 20) $find_mob = GuiCtrlCreateGroup("Find Mob", 10, 10, 250, 50) $find_item = GuiCtrlCreateGroup("Find Item", 10, 60, 250, 50) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $mob_button $data = GUICtrlRead($mob_input) $rc = _INetBrowse("http://eqbeastiary.allakhazam.com/search.shtml?name=" & $data) Case $msg = $item_button $data2 = GUICtrlRead($item_input) $rc = _INetBrowse("http://everquest.allakhazam.com/db/searchdb.html?iname=" & $data2) Case Else ;;; EndSelect WEnd Func _INetBrowse($s_URL, $i_OPT = 2) ;w0uters functions Switch $i_OPT Case 0 RunWait(@ComSpec & ' /c start ' & $s_URL, @WorkingDir, @SW_HIDE) Return 1 Case 1 RunWait("rundll32.exe url.dll,FileProtocolHandler " & $s_URL, @WorkingDir) Return 1 Case 2 DllCall("Shell32.dll", "int", "ShellExecute", "hwnd", 0, "str", 'open', "str", $s_URL, "str", '', "str", @WorkingDir, "int", 10) Return 1 Case 3 $o_SA = ObjCreate('Shell.Application') $o_SA.Open ($s_URL) Return 1 EndSwitch Return 0 EndFunc ;==>_INetBrowse Edit: Left "start" in as evil reminded me to remove them, thanks... Edited July 10, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
evilertoaster Posted July 10, 2006 Share Posted July 10, 2006 Forgot to take the 'starts' out of your function call (else it won't work) Why is that better? ShellExacute is identical to the "start" command i thought? Link to comment Share on other sites More sharing options...
Jabberwock Posted July 10, 2006 Author Share Posted July 10, 2006 works great, thank you very much! it would be great if i could press enter and it do the function for me, i know it can be done with _IsPressed, but since there are multiple fields that won't work? Link to comment Share on other sites More sharing options...
evilertoaster Posted July 10, 2006 Share Posted July 10, 2006 someone might have a better way of doing this... expandcollapse popup#include <GuiConstants.au3> #include <Process.au3> GuiCreate("Search Allakhazam.com", 273, 125,-1, -1) HotKeySet("{enter}","Check") $mob_input = GuiCtrlCreateInput("", 20, 30, 130, 20) $mob_button = GuiCtrlCreateButton("Go", 160, 30, 90, 20) $item_input = GuiCtrlCreateInput("", 20, 80, 130, 20) $item_button = GuiCtrlCreateButton("Go", 160, 80, 90, 20) GuiCtrlCreateGroup("Find Mob", 10, 10, 250, 50) GuiCtrlCreateGroup("Find Item", 10, 60, 250, 50) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $mob_button CheckMob() Case $msg = $item_button CheckItem() Case Else ;;; EndSelect WEnd Exit Func Check() If WinGetState("Search Allakhazam.com")=15 Then If BitOr($GUI_FOCUS,GUICtrlGetState($mob_input)) then CheckMob() If BitOr($GUI_FOCUS,GUICtrlGetState($item_input)) then CheckItem() Else HotKeySet("{enter}") Send("{enter}") HotKeySet("{enter}","Check") EndIf Return EndFunc Func CheckMob() $data=StringReplace(GUICtrlRead($mob_input)," ","+") $rc = _RunDos("start http://eqbeastiary.allakhazam.com/search.shtml?name=" & $data) EndFunc Func CheckItem() $data2 = StringReplace(GUICtrlRead($item_input)," ","+") $rc = _RunDos("start http://everquest.allakhazam.com/db/searchd...ml?iname=" & $data2) EndFunc Link to comment Share on other sites More sharing options...
i542 Posted July 11, 2006 Share Posted July 11, 2006 What a......nice script! i542 I can do signature me. 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