ok - that worked fine for the example but when I moved my 4Button stuff up in the real code it still did not work. Here is what I have:
Code:
gui, 4:Add, Text,, ATG Username
gui, 4:Add, Edit, vAuthUser,
gui, 4:Add, Text,, ATG Password
Gui, 4:Add, Edit, vAuthPass,
Gui, 4:Add, Button, Default, OK
gui, 4:Show
return
4ButtonOK:
Gui, 4:submit
;msgbox, %AuthUser% `n %AuthPass%
;FileDelete, Auth.txt
;UrlDownloadToFile, http://automatethegame.com/forums/auth.php?user=%AuthUser%&pass=%AuthPass%, Auth.txt
IfNotExist, Auth.txt
{
Msgbox, 64, Cartel v1.01, There was a problem connecting to the forum. Try again later.
ExitApp
}
FileRead, Auth, Auth.txt
;msgbox %auth%
;FileDelete, Auth.txt
If Auth = 1
{
Msgbox, 64, Cartel v1.01, Your authorization info is not valid. You need to be a subscriber to use our applications. Renter your info and try again.
ExitApp
}
If Auth != 0
{
Msgbox, 64, Cartel v1.01, There was a problem connecting to the forum. Try again later.
ExitApp
}
Gui, 4:Destroy
gosub, start
return
start:
iniRead, Phone, Settings.ini, Phone, 1
if Phone = ERROR
Phone = 1235551212
iniRead, Email, Settings.ini, Email, 1
if Email = ERROR
Email = Example@example.com
iniread, sleepTime, Settings.ini, SleepTime, 1
if SleepTime = ERROR
SleepTime := ""
iniread, sleepTemp, Settings.ini, SleepTime, 2
if SleepTemp = ERROR
SleepTemp = 1 Minute|5 Minutes||15 Minutes|30 Minutes|1 Hour|6 Hours|12 Hours|24 Hours
LOCDDL := ""
iniRead, SavedSearches, CLINFO.ini, 1, 1
if SavedSearches = ERROR
SavedSearches := ""
;urldownloadtofile, http://www.craigslist.org/about/sites, locations.html
fileread, loc, locations.html
BEG := InStr(loc,"http://geo.craigslist.org/iso/us/al")
BEG -= 10
StringTrimLeft, loc, loc, %BEG%
BEG := InStr(loc, "<b>ca cities</b>")
BEG -= 1
StringLeft, Temp1, loc, %BEG%
BEG := InStr(loc, ">bangladesh</a>")
BEG -= 42
StringTrimLeft, loc, loc, %BEG%
BEG := InStr(loc, "http://amsterdam.craigslist.org/")
BEG -= 9
END := InStr(loc, "</html> ")
END += 7
Temp2 := END-BEG
StringTrimRight, loc, loc, %Temp2%
temp3 = %TEMP1% %loc%
loop
{
BEG := InStr(temp3, "<a href=")
if %BEG% = 0
break
BEG += 8
StringTrimLeft, Temp3, Temp3, %BEG%
END := InStr(temp3, ">")
END -= 2
StringLeft, LOCURL, Temp3, %END%
END += 2
StringTrimLeft, Temp3, Temp3, %END%
BEG := InStr(temp3, "</a>")
BEG -= 1
StringLeft, LOCName, Temp3, %BEG%
LOCDDL = %LOCDDL%%LOCName%|
iniWrite, %LOCURL%, Locations.ini, %LOCName%, 1
}
setSub = Choose Category First
;;;Define categories;;;
Categories = Community|Personals|housing|forsale|Services|jobs|gigs
Community = |activities|artists|childcare|general|groups|pets|events|lost and found|musicians|local news|politics|rideshare|volunteers|classes
personals = |strictly platonic|woman seek woman|woman seeking men|men seeking woman|men seeking men|misc romance|casual encounters|missed connections|rants and raves
housing = |apts/housing|rooms/shared|sublets/temporary|housing wanted|housing swap|vacation rentals|parking/storage|office/commercial|real estate for sale
forsale = |appliances|antiques|barter|bikes|boats|books|business|computer|free|furniture|general|jewelry|materials|rvs|sporting|tickets|tools|wanted|arts+crafts|auto parts|baby+kids|beauty+health|cars+trucks|cds/dvds/vhs|cell phones|clothes+acc|collectibles|electronics|farm+garden|garage sale|household|motorcycles|music instr|photo+video|toys+games|video gaming
services = |beauty|computer|creative|event|financial|legal|lessons|pet|adult|automotive|farm+garden|household|labor/move|skill'd trade|real estate|sm bi ads|therapeutic|travel/vac|write/ed/tr8
jobs = |accounting+finance|admin/office|arch/engineering|art/media/design|biotech/science|business/mgmt|customer service|education|food/bev/hosp|general labor|government|human resources|internet engineers|legal/paralegal|manufacturing|marketing/pr/ad|medical/health|nonprofit sector|real estate|retail/wholesale|sales/bi dev|salon/spa/fitness|security|skilled trade/craft|software/qa/dba|systems/network|technical support|transport|tv/film/video|web/info design|writing/editing|ECT|Part time
gigs = |computer|creative|crew|domestic|event|labor|writing|talent|adult
;;;;;/categories defined
Gui, Font, S36 CRed Bold Underline, Verdana
Gui, Add, Text, x16 y7 w540 h80 +Center, Craigs List Monitor
Gui, Font, ,
Gui, Add, Text, x16 y427 w90 h30 , Email Address
Gui, Add, Edit, x126 y387 w130 h20 vPhone, %Phone%
Gui, Add, Text, x16 y387 w90 h30 , Phone Number
Gui, Add, Edit, x126 y427 w130 h20 vEmail, %Email%
Gui, Add, Button, x16 y467 w400 h30 , Search
Gui, Add, Text, x15 y96 w110 h30 , Location
Gui, Add, DropDownList, x145 y96 w110 vLocation , %LOCDDL%
Gui, Add, Text, x16 y257 w110 h30 , Search Phrase
Gui, Add, Edit, x146 y257 w190 h30 vPhrase,
Gui, Add, Text, x15 y136 w110 h30 , Specific Location
Gui, Add, DropDownList, x146 y137 w110 vSpecific, Choose Location First
;Gui, Add, Text, x346 y97 w210 h20 , Defined Searches
;Gui, Add, Text, x346 y127 w210 h290 , Text
Gui, Add, ListView, x345 y96 w210 h310 gLView Checked , Active|Search Terms
loop, Parse, SavedSearches, |
{
iniRead, Temp1, CLINFO.ini, %A_LoopField%, 1
iniRead, Temp2, CLINFO.ini, %A_LoopField%, 2
LV_Add(Temp1,"" ,Temp2)
}
Gui, Add, Button, x16 y297 w320 h40 , SaveSearch
Gui, Add, Text, x15 y176 w110 h30 , Category
;Gui, Add, DropDownList, x145 y176 w110 vTopCategory gSetCategory , %Categories%
Gui, Add, Text, x15 y216 w110 h30 , Sub-Category
Gui, Add, DropDownList, x145 y216 w110 vSubCategory, Choose Category First
Gui, Add, Button, x456 y457 w100 h40 , Help
Gui, Add, Text, x16 y347 w90 h30 , Search every:
;ui, Add, DropDownList, x126 y347 w130 vSleepTemp gSetTime, %SleepTemp%
; Generated using SmartGUI Creator 4.0
Gui, Show, x196 y163 h509 w580, Craigs List Monitor - By AutomateTheGame.com
Return
ButtonSaveSearch:
msgbox ITS RUNNING SAVE SEARCH
Gui, Submit, NoHide
iniRead, URLLOC, locations.ini, %Specific%, 1
;urldownloadtofile, %URLLOC%, categories.txt
sleep, 1000
fileread, tempcat, categories.txt ;;;Will be the URL to categories
END := InStr(tempcat, SubCategory)
END -= 3
StartPos := END-45
BEG := InStr(tempcat, "a href=",false, startpos)
BEG += 8
Get := END - BEG
StringMid, NewStr, tempcat, %BEG%, %Get%
URLLOC = %URLLOC%search/%NewStr%/
StringREplace, phrase, phrase, %A_Space%, +, All
FinalSearch = %URLLOC%?query=%phrase%
iniWrite, check, CLINFO.ini, %phrase%, 1
iniWrite, %phrase%, CLINFO.ini, %phrase%, 2
iniWrite, %FinalSearch%, CLINFO.ini, %phrase%, 3
if SavedSearches =
{
iniWrite, %phrase%, CLINFO.ini, 1, 1
}
else
iniWrite, %SavedSearches%|%phrase%, CLINFO.ini, 1, 1
reload
return
LView:
MsgBox,4,Craigs List Monitor - By AutomateTheGame.com, Do You Want to Delete this search?
ifMsgBox No
return
iniRead, SavedSearches, CLinfo.ini, 1, 1
loop, Parse, SavedSearches, |
{
if A_Index = %A_EventInfo%
{
StringReplace, SavedSearches, SavedSearches, %A_LoopField%
StringReplace, SavedSearches, SavedSearches, ||, |
StringRight, lastcheck, SavedSearches, 1
if lastcheck = |
{
stringtrimright, SavedSearches, SavedSearches, 1
}
IniDelete, CLinfo.ini, %A_LoopField%
IniWrite, %SavedSearches%, CLInfo.ini, 1, 1
IniRead, SavedSearches, CLinfo.ini, 1, 1
StringLeft, temp5, SavedSearches, 1
if temp5 = |
{
StringReplace, SavedSearches, SavedSearches, |
iniWrite, %SavedSearches%, CLInfo.ini, 1, 1
}
reload
break
}
}
return