Project almost done, But a very problematic situation

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
jj45410
Junior Coder
Posts: 38
Joined: Tue Nov 18, 2008 8:14 pm

Project almost done, But a very problematic situation

Post by jj45410 » Sat Dec 06, 2008 3:58 am

Subject name is a bit overated
Ok, guys. basically what is happening is the website or ANYTHING that I tell the menu to open, Repeats itself over and over and over again... Please point out the code that is doing this. The main menu part works fine, but its what is below that is repeating itself over and over again... Even the subroutines are doing it. So websites and subroutines are the problem. Thank you.
jj45410

Be aware, that if you do test this code, then it will loop over and over again untill Macro Scheduler is closed, and macro scheduler only. or if you abort but thats hard with 50 or so windows popping up.

Code: Select all

Dialog>dialog1
   Caption=Test Menu242
   Width=297
   Height=255
   Top=104
   Left=CENTER
   Button=Run Tasks,130,146,98,20,3
   Button=Exit Macro,130,170,97,20,2
   CheckBox=msCheckbox1,DWC,24,140,97,False
   CheckBox=msCheckbox2,Start Disk Defrag,24,160,97,False
   CheckBox=msCheckbox3,Start Disk Clean,24,180,97,False
   Button=www.youtube.com,24,17,120,25,10
   Button=www.myspace.com,24,48,120,25,11
   Button=www.yahoo.com,24,80,120,25,12
   Button=www.mjtnet.com,24,112,120,25,13
   Button=www.google.com,150,17,120,25,14
   Button=www.itunes.com,150,48,120,25,15
   Button=www.Morrowind.com,150,80,120,25,16
   Button=www.aol.com,150,112,120,25,17
   Image=C:\Documents and Settings\Goergia\My Documents\My Pictures\Backroundmenu1.bmp,0,0,289,201,msImage1,0
   MainMenu=Browsers,IExplorer(101),FireFox(102)
   MainMenu=Applications,NotepPad(201),Paint(202),Itunes(203)
   MainMenu=Games,World Of Warcraft(301),Counter Strike(302)
EndDialog>dialog1
Show>dialog1

Label>MainLoop
GetDialogAction>dialog1,result
If>result=2
  exit>
Endif
if>result=101
Run Program>C:\Program Files\Internet Explorer\iexplore.exe  
  ResetDialogAction>dialog1
Endif
if>result=102
Run Program>C:\Program Files\Mozilla Firefox\firefox.exe
  ResetDialogAction>dialog1
Endif
if>result=201
Run Program>C:\WINDOWS\system32\notepad.exe
  ResetDialogAction>dialog1
Endif
if>result=202
Run Program>C:\WINDOWS\system32\mspaint.exe
   ResetDialogAction>dialog1
Endif
 if>result=203
Run Program>C:\Documents and Settings\Kathern\Desktop\iTunes\iTunes Library.itl
  ResetDialogaction>dialog1
Endif
  if>result=301
Run Program>C:\Program Files\World of Warcraft\Launcher.exe
  ResetDialogaction>dialog1
Endif
 if>result=302
Run Program>C:\Program Files\Steam\steam.exe
  ResetDialogaction>dialog1
Endif
wait>0.01
If>result=10
  Exe>http://www.youtube.com
EndIf
If>result=11
  Exe>http://www.myspace.com
EndIf
If>result=12
  Exe>http://www.yahoo.com
EndIf
If>result=13
  Exe>http://www.mjtnet.com
Endif
If>result=14
  Exe>http://www.google.com
Endif
If>result=15
  Exe>http://www.itunes.com
Endif
If>result=16
  Exe>http://www.morrowind.com
Endif
If>result=17
  Exe>http://www.aol.com
Endif
if>result=2,End
if>result=3
if>dialog1.msCheckbox1=True,Del WoW Cache
if>dialog1.msCheckbox2=True,Start Disk Defrag
if>dialog1.msCheckbox3=True,Start Disk Clean
if>dialog1.msCheckbox4=True,Start Itunes
endif
Goto>MainLoop

Label>End

SRT>Del WoW Cache
IfDirExists>C:\Program Files\World of Warcraft\Cache
del>C:\Program Files\World of Warcraft\Cache
messagemodal>Cache Deleted
else
MessageModal>Cache Does Not Exsist
endif
END>Del WoW Cache

SRT>Start Disk Defrag
ExecuteFile>C:\WINDOWS\system32\dfrg.msc,
END>Start Disk Defrag

SRT>Start Disk Clean
ExecuteFile>C:\WINDOWS\system32\cleanmgr.exe,
END>Start Disk Clean
Last edited by jj45410 on Sat Dec 06, 2008 11:09 am, edited 1 time in total.

jj45410
Junior Coder
Posts: 38
Joined: Tue Nov 18, 2008 8:14 pm

Post by jj45410 » Sat Dec 06, 2008 5:01 am

Well, The script is fixed . Figured it out
The problem was that I had
The GetDialogAction>dialog1,result inside the loop.
2nd problem was Show>dialog1 should have been Show>dialog1,result
3rd and last problem. Just before the goto>mainloop I put a let>result=1 and that fixed the pages coming in and in.

User avatar
JRL
Automation Wizard
Posts: 3518
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Sat Dec 06, 2008 6:10 am

As I pointed out in your other post on this script you need to use the resetdialogaction function.

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Sat Dec 06, 2008 8:01 am

Feel free to remove the word "hostile" from your subject. Seems you had a simple error in your code, rather than our software being hostile!
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

jj45410
Junior Coder
Posts: 38
Joined: Tue Nov 18, 2008 8:14 pm

Post by jj45410 » Sat Dec 06, 2008 11:08 am

I wasn't saying the software itself was hostile.. I said the "simple error" was.. Ever try geting past 89 Disk defragment windows? lol.. You should try it sometime.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts