Jump to content

Quote problem


Recommended Posts

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

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 by evilertoaster
Link to comment
Share on other sites

  • Moderators

I would prefer this method personally:

#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 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

someone might have a better way of doing this...

#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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...