Sign in to follow this  
Followers 0
CsM33

Will this work?

7 posts in this topic

#1 ·  Posted (edited)

I'm wondering if the code below will work if i'm trying to open firefox and go to that url. I can't test it at the moment.

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.1.1.0
 Author:         Chris aKa LmFaO

 Script Function:
    My autoit Program for Gamebattles.com

#ce ----------------------------------------------------------------------------

#include <GUIConstants.au3>
#include <IE.au3>

GUICreate("Gamebattles Desktop S3 Edition 1.01",380,300)

Global $defaultstatus = "Ready"
Global $status

GuiCtrlCreatePic("gb_xbox.jpeg",225,0, 150,70)

GUICtrlCreateLabel ("GB Desktop Socom Three Edition: V1.01", 10,20,200,15)
GUICtrlSetColor(-1,0xff0000)  

$mainpage = GUICtrlCreateButton ("Main S3 Page", 10,50,125,25)

$filemenu = GUICtrlCreateMenu ("&File")
$Credits = GUIctrlcreatemenuitem ("Credits", $filemenu)
$contactme = GUICtrlCreateMenuitem ("Contact Me",$filemenu)
$exititem = GUICtrlCreateMenuitem ("Exit",$filemenu)

$cancelbutton = GUICtrlCreateButton ("Close",300,200,70,20)
GUICtrlSetState(-1,$GUI_FOCUS)
$tab=GUICtrlCreateTab (10,80, 350,175)

$tab0=GUICtrlCreateTabitem ("FORUMS")
$mainforums = GUICtrlCreateButton ("Main", 60,150,75,30)
$pbpforums = GUICtrlCreateButton ("Play By Play", 150,150,100,30)
$recforums = GUICtrlCreateButton ("Recruiting", 150,200,100,30)
$vidforums = GUICtrlCreateButton ("Videos", 60,200,75,30)

$tab2=GUICtrlCreateTabItem ("STANDINGS")
$cladder = GUICTRLCREATEBUTTON ("Clan", 60,150,75,30)
$sqladder = GUICtrlCreateButton ("Squads", 150,150,100,30)
$dladder = GUICtrlCreateButton ("Doubles", 150,200,100,30)
$siladder = GUICtrlCreateButton ("Singles", 60,200,75,30)

$tab3=GUICtrlCreateTabItem ("QUICKLINKS")
$staffql = GUICtrlCreateButton ("Staff", 60,150,75,30)
$searchql = GUICtrlCreateButton ("Search", 150,150,100,30)
$mfql = GUICtrlCreateButton ("Match Finder", 150,200,100,30)
$manageql = GUICtrlCreateButton ("Manage", 60,200,75,30)

$tab4=GUICtrlCreateTabItem ("PROGRAMS")
$aim = GUICtrlCreateButton ("Aim", 60,150,75,30)
$skype = GUICtrlCreateButton ("Skype", 150,150,100,30)
$taskman = GUICtrlCreateButton ("Task Manager", 150,200,100,30)


GUICtrlCreateTabitem ("")

GUISetState ()
While 1
    $msg = GUIGetMsg()
    
   If $msg = $mainpage then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://socom3.gamebattles.com","")
    If $msg = $credits Then Msgbox(0,"Credits go to LmFaO","This is my (LmFaO) first program using Autoit. I hope you like it!")
    If $msg = $Cancelbutton then Exit
    If $msg = $mainforums then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://forums.gamebattles.com/f/376.htm","")
    If $msg = $pbpforums then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://forums.gamebattles.com/f/758.htm","")
    If $msg = $recforums then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://forums.gamebattles.com/f/581.htm","")
    If $msg = $vidforums then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://forums.gamebattles.com/f/731.htm","")
    If $msg = $cladder then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://socom3.gamebattles.com/ladders.php?id=382","")
    If $msg = $sqladder then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://socom3.gamebattles.com/ladders.php?id=236","")
    If $msg = $dladder then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://socom3.gamebattles.com/ladders.php?id=238","")
    If $msg = $siladder then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://socom3.gamebattles.com/ladders.php?id=239","")
    If $msg = $aim then Run("C:\Program Files\Aim\Aim.exe")
    If $msg = $skype then Run("C:\Program Files\Skype\Phone\Skype.exe")
    If $msg = $taskman then Run("C:\Windows\Taskman.exe")
    If $msg = $staffql then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://socom3.gamebattles.com/staff.php","")
    If $msg = $searchql then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://socom3.gamebattles.com/search.php","")
    If $msg = $mfql then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://socom3.gamebattles.com/matches.php","")
    If $msg = $manageql then Run("C:\Program Files\Mozilla Firefox\FireFox.exe http://socom3.gamebattles.com/manage.php","")    If $msg = $contactme then msgbox(0, "Name: Chris, GB Name: GBLmFaOGB, Aim: s3LmFaO // GyMcLa5sHeRo, Skype: lmfao-, Msn: dotdottequila@hotmail.com")
  
WEnd


GUISetState ()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop

    Wend
        GUIDelete()
    
Exit
Edited by CsM33

Share this post


Link to post
Share on other sites



Don't suppose you bothered to try it? It looks like it will work.


[center]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.[/center]

Share this post


Link to post
Share on other sites

Don't suppose you bothered to try it? It looks like it will work.

I edited the above post explaining why. I'm not at home at the moment.

Share this post


Link to post
Share on other sites

It does not run on my system :)

Mine either... I wonder whats wrong.

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Yes, it works... after some tweaking...

like, the #include "IE.au3" you don't need, since you are trying to run firefox...

last $msgline, make sure the if statement is on a separate line.

and... the last msgbox line is missing the [title] ie. you need one more comma somewhere... I did it like

If $msg = $contactme then msgbox(0, "","Name: Chris, GB Name: GBLmFaOGB, Aim: s3LmFaO // GyMcLa5sHeRo, Skype: lmfao-, Msn: dotdottequila@hotmail.com")

one thing to think about is the location of the firefox executable, maybe use the setting from the registry(a bit tricky) instead of a static line. or make a findfile() to point to the default directory, if it's not there, browse for the location and set it in a registry setting somewhere (to make it work on most computers).

you could also make the actual URL-open as a function to save a bit of space. It's all a matter of preference of course.

Edited by jinxter

> there are 10 types of people in the world, those who understand binary and those who don't.

Share this post


Link to post
Share on other sites

#include <IE.au3>;???????? IE is Internet Explorer (not firefox)


[quote name='AceLoc']I gots new sunglasses there cool.[/quote]

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  
Followers 0