Jump to content
Sign in to follow this  
jrkpote

get info from website

Recommended Posts

jrkpote

hello, i would get info from a config.ini localizated in my web server http://localhost/loader/config.ini

config.ini

[Main]
Title=Aragor WoW Server
Logo=http://localhost/loader/logo.jpg
News=http://localhost/loader/news.txt
BgColor=0x000000
Drive=C:/
Realmlist=set realmlist 192.168.0.1
Realmlist2=set realmlist 127.0.0.1

loader.au3

#include <GUIConstants.au3>
#include <Process.au3>
#include <INet.au3>
#include <IE.au3>
#NoTrayIcon

Global $URL = "http://localhost/loader/"

$config = _INetGetSource($URL & "config.ini")
$title = IniRead($config, "Main", "Title", "WoW Launcher")
$logo = IniRead($config, "Main", "Logo", "")
$news = IniRead($config, "Main", "News", "")
$wowdir = ".\"
$realmlist = FileRead($wowdir & "realmlist.wtf")
$eu_realmlist = IniRead($config, "Main", "Realmlist2", "")
$_realmlist = IniRead($config, "Main", "Realmlist", "")
$bgcolor = IniRead($config, "Main", "BgColor", "0xFFFFFF")
$gui = GUICreate($title, 410, 310)
$custom = GUICtrlCreateButton("botton1", 45, 280, 100)
$original_eu = GUICtrlCreateButton("botton2", 255, 280, 100)
$news = _INetGetSource($URL & "news.txt")
$news = FileRead($URL & "news.txt")
$logo = _INetGetSource($logo, "logo.jpg")
$logodisp = GUICtrlCreatePic("logo.jpg", 5, 5, 400, 100)
$newsdisp = GUICtrlCreateEdit($news, 5, 105, 400, 170, $ES_READONLY+$WS_VSCROLL)
GUISetBkColor($bgcolor)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $original_eu
        $rc = _RunDos("rmdir /S /Q cache")
        DirRemove(".\cache")
        FileDelete($wowdir & "realmlist.wtf")
        FileWrite($wowdir & "realmlist.wtf", $eu_realmlist)
        ExitLoop
    Case $msg = $custom
        $rc = _RunDos("rmdir /S /Q cache")
        DirRemove(".\cache")
        FileDelete($wowdir & "realmlist.wtf")
        FileWrite($wowdir & "realmlist.wtf", $_realmlist)
        ExitLoop
    EndSelect
WEnd

please help me, and sorry for my english

Edited by jrkpote

Share this post


Link to post
Share on other sites
d4rk

what's the problem ?


[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Share this post


Link to post
Share on other sites
ProgAndy

IniREad is only possible with files:

$config = @TempDir & "\temp.ini"

INetGet($URL & "config.ini",$config,1)

$title = IniRead($config, "Main", "Title", "WoW Launcher")

$logo = IniRead($config, "Main", "Logo", "")

$news = IniRead($config, "Main", "News", "")


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
jrkpote

not spawn info and logo

http://www.imapeg.com/fullviewer/loader330....jpg/index.html

it don't get the info in config.ini

EDIT:

IniREad is only possible with files:

$config = @TempDir & "\temp.ini"

INetGet($URL & "config.ini",$config,1)

$title = IniRead($config, "Main", "Title", "WoW Launcher")

$logo = IniRead($config, "Main", "Logo", "")

$news = IniRead($config, "Main", "News", "")

get background color but not logo and news

Edited by jrkpote

Share this post


Link to post
Share on other sites
ProgAndy

Also, delete this line: $news = FileRead($URL & "news.txt")

And Change these lines:

$news = _INetGetSource($news)

..

INetGet($logo, @SciptDir & "\logo.jpg")

$logodisp = GUICtrlCreatePic(@ScriptDir & "\logo.jpg", 5, 5, 400, 100)

Edited by ProgAndy

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites
jrkpote

Global $URL = "http://localhost/loader/"

$config = @TempDir & "\temp.ini"
INetGet($URL & "config.ini",$config,1)
$title = IniRead($config, "Main", "Title", "WoW Launcher")
$logo = IniRead($config, "Main", "Logo", "")
$news = IniRead($config, "Main", "News", "")
$wowdir = ".\"
$realmlist = FileRead($wowdir & "realmlist.wtf")
$eu_realmlist = IniRead($config, "Main", "Realmlist2", "")
$_realmlist = IniRead($config, "Main", "Realmlist", "")
$bgcolor = IniRead($config, "Main", "BgColor", "0xFFFFFF")
$gui = GUICreate($title, 410, 310)
$custom = GUICtrlCreateButton("botton1", 45, 280, 100)
$original_eu = GUICtrlCreateButton("botton2", 255, 280, 100)
$news = _INetGetSource($URL & "news.txt")
$news = _INetGetSource($news)
$logo = _INetGetSource($URL & "logo.jpg")
INetGet($logo, @SciptDir & "\logo.jpg")
$logodisp = GUICtrlCreatePic(@ScriptDir & "\logo.jpg", 5, 5, 400, 100) 
$newsdisp = GUICtrlCreateEdit($news, 5, 105, 400, 170, $ES_READONLY+$WS_VSCROLL)
GUISetBkColor($bgcolor)
GUISetState()

Line -1:

Error: Unknown macro

Edited by jrkpote

Share this post


Link to post
Share on other sites
jrkpote

#include <GUIConstants.au3>
#include <Process.au3>
#include <INet.au3>
#include <IE.au3>
#NoTrayIcon

Global $URL = "http://localhost/loader/"

$logo = _INetGetSource($URL & "logo.jpg")
INetGet($URL & "logo.jpg", @TempDir & "\logo.jpg", 1)
$config = @TempDir & "\temp.ini"
INetGet($URL & "config.ini",$config,1)
$title = IniRead($config, "Main", "Title", "WoW Launcher")
$logo = IniRead($config, "Main", "Logo", "")
$news = IniRead($config, "Main", "News", "")
$wowdir = ".\"
$realmlist = FileRead($wowdir & "realmlist.wtf")
$eu_realmlist = IniRead($config, "Main", "Realmlist2", "")
$_realmlist = IniRead($config, "Main", "Realmlist", "")
$bgcolor = IniRead($config, "Main", "BgColor", "0xFFFFFF")
$gui = GUICreate($title, 410, 310)
$news = _INetGetSource($URL & "news.txt")
INetGet($news, @TempDir & "\logo.jpg", 1)
$custom = GUICtrlCreateButton("botton1", 45, 280, 100)
$original_eu = GUICtrlCreateButton("botton2", 255, 280, 100)
$logodisp = GUICtrlCreatePic(@TempDir & "\logo.jpg", 5, 5, 400, 100) 
$newsdisp = GUICtrlCreateEdit($news, 5, 105, 400, 170, $ES_READONLY+$WS_VSCROLL)
GUISetBkColor($bgcolor)
GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $original_eu
        $rc = _RunDos("rmdir /S /Q cache")
        DirRemove(".\cache")
        FileDelete($wowdir & "realmlist.wtf")
        FileWrite($wowdir & "realmlist.wtf", $eu_realmlist)
        ExitLoop
    Case $msg = $custom
        $rc = _RunDos("rmdir /S /Q cache")
        DirRemove(".\cache")
        FileDelete($wowdir & "realmlist.wtf")
        FileWrite($wowdir & "realmlist.wtf", $_realmlist)
        ExitLoop
    EndSelect
WEnd

code finish

thanks for your help

PS: sorry for the doble-post

Edited by jrkpote

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  

×