  
  #DEFINE FUNCTION,WIN64 
  
  inifile open,@path(%0)d3help.ini
  
 title Diablo III Helper
  DIALOG CREATE,Diablo III Helper,-1,0,625,417
REM *** Modified by Dialog Designer on 8/29/2012 - 00:30 ***
  DIALOG ADD,STYLE,STYLE1,,,B,,
  DIALOG ADD,list,list1,0,0,0,0
  dialog add,list,list2,0,0,0,0
  DIALOG ADD,GROUP,GROUP1,15,27,180,126,Primary Loop
  DIALOG ADD,GROUP,GROUP2,150,27,180,126,Secondary Loop
  DIALOG ADD,CHECK,CHECK1,39,34,30,18,1
  DIALOG ADD,CHECK,CHECK2,63,34,30,18,2
  DIALOG ADD,CHECK,CHECK3,87,34,30,18,3
  DIALOG ADD,CHECK,CHECK4,109,34,30,18,4
  DIALOG ADD,CHECK,CHECK5,39,72,90,18,Q (Potions)
  DIALOG ADD,CHECK,CHECK6,63,73,80,18,Right Click
  DIALOG ADD,CHECK,CHECK7,86,72,70,18,Left Click
  DIALOG ADD,CHECK,sCHECK1,174,34,30,18,1
  DIALOG ADD,CHECK,sCHECK2,198,34,30,18,2
  DIALOG ADD,CHECK,sCHECK3,222,34,30,18,3
  DIALOG ADD,CHECK,sCHECK4,244,34,30,18,4
  DIALOG ADD,CHECK,sCHECK5,174,72,90,18,Q (Potions)
  DIALOG ADD,CHECK,sCHECK6,198,73,80,18,Right Click
  DIALOG ADD,CHECK,sCHECK7,222,72,70,18,Left Click
  DIALOG ADD,GROUP,GROUP4,13,211,379,135,Launcher
  DIALOG ADD,BUTTON,Button1,30,220,90,24,Launch Game
  DIALOG ADD,GROUP,Group3,146,218,197,97,Performance Warp
  DIALOG ADD,MENU,System,Kill Explorer,Start Explorer,-,Kill DWM,Start DWM,-,Setup/Update Second Launch (Robocopy),Remove Second Launch,-,Search for Iobit Game Booster
  DIALOG ADD,MENU,Options,Calibrate Window Borders,-,Set Directory,-,Ontop this session
  DIALOG ADD,TEXT,TEXT1,281,26,,,HOME starts loop,,STYLE1
  DIALOG ADD,TEXT,TEXT2,299,27,,,END stops loop,,STYLE1
  DIALOG ADD,CHECK,CHECK8,86,220,100,18,High Priority,1
  DIALOG ADD,BUTTON,BUTTON6,58,220,90,24,Launch 2nd
  DIALOG ADD,CHECK,CHECK9,108,220,100,18,Windowed,,,click
  DIALOG ADD,TEXT,TEXT3,134,224,,,Windowed
  DIALOG ADD,GROUP,GROUP5,250,223,133,83,Update Diablo III
  DIALOG ADD,BUTTON,BUTTON8,271,230,115,24,Launch Updater
  DIALOG ADD,BUTTON,BUTTON9,297,230,115,24,Update 2nd Launch
  DIALOG ADD,BUTTON,BUTTON10,249,181,20,24,?
  DIALOG ADD,BUTTON,BUTTON11,112,176,20,24,?
  DIALOG ADD,TEXT,TEXT4,86,325,,,Cores
  DIALOG ADD,EDIT,EDIT1,105,323,41,19
  DIALOG ADD,BUTTON,BUTTON12,102,367,16,24,!
  DIALOG ADD,TEXT,TEXT5,173,340
  DIALOG ADD,BUTTON,BUTTON7,155,390,20,24,?
  DIALOG ADD,BUTTON,BUTTON13,173,225,40,24,<-->,Stretch
  DIALOG ADD,GROUP,GROUP6,325,15,400,85,Quick "%" Calc
  DIALOG ADD,EDIT,EDIT5,350,20,50,19
  DIALOG ADD,BUTTON,TEXT13,351,70,20,20,+
  DIALOG ADD,EDIT,EDIT6,350,89,55,19
  DIALOG ADD,TEXT,TEXT14,352,150,,,==>
  DIALOG ADD,EDIT,EDIT2,350,175,50,24
  DIALOG ADD,TEXT,TEXT6,352,230,,,/
  DIALOG ADD,EDIT,EDIT3,350,250,50,24
  DIALOG ADD,TEXT,TEXT7,352,305,,,=
  DIALOG ADD,EDIT,EDIT4,350,320,50,24
  DIALOG ADD,TEXT,TEXT8,352,375,,,"%"
  DIALOG ADD,EDIT,EDIT5b,375,20,50,19
  DIALOG ADD,BUTTON,TEXT13b,376,70,20,20,+
  DIALOG ADD,EDIT,EDIT6b,375,89,55,19
  DIALOG ADD,TEXT,TEXT14b,377,150,,,==>
  DIALOG ADD,EDIT,EDIT2b,375,175,50,24
  DIALOG ADD,TEXT,TEXT6b,377,230,,,/
  DIALOG ADD,EDIT,EDIT3b,375,250,50,24
  DIALOG ADD,TEXT,TEXT7b,377,305,,,=
  DIALOG ADD,EDIT,EDIT4b,375,320,50,24
  DIALOG ADD,TEXT,TEXT8b,377,375,,,"%"
  DIALOG ADD,text,ratio,202,228,,,ASPECT RATIO
  DIALOG ADD,TEXT,TEXT9,217,228,,,4:3 -
  DIALOG ADD,TEXT,TEXT10,217,254,,,00"%"
  DIALOG ADD,TEXT,TEXT11,217,297,,,16:9 -
  DIALOG ADD,TEXT,TEXT12,217,331,,,00"%"
  DIALOG ADD,BUTTON,BUTTON2,173,270,24,24,+,Save this point instead of screen resolution
  DIALOG ADD,BUTTON,BUTTON3,173,295,24,24,*,Set point to screen resolution
  DIALOG ADD,CHECK,CHECK10,25,400,150,18,Disable Trilinear Filtering,,,click
  DIALOG ADD,CHECK,CHECK11,45,400,150,18,Disable Antialiasing,,,click
  DIALOG ADD,CHECK,CHECK12,65,400,150,18,Low Quality Bitmaps,,,click
  DIALOG ADD,CHECK,CHECK13,85,400,150,18,Disable Shadows,,,click
  DIALOG ADD,CHECK,CHECK14,105,400,150,18,Low Physics,,,click
  DIALOG ADD,CHECK,CHECK15,125,400,150,18,No Clutter Objects,,,CLICK
  DIALOG ADD,CHECK,CHECK16,106,485,100,18,Force Hardware,,,click
   DIALOG SHOW
   
   if @greater(@sysinfo(winver),5.9)
   if @not(@file(C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt))
   directory create,C:\Users\@env(username)\Documents\Diablo III
   file copy,@path(%0)d3prefs.txt,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   end
   list loadfile,list2,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   else
   if @not(@file(C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt))
   directory create,C:\Documents and Settings\@env(username)\My Documents\Diablo III
   file copy,@path(%0)d3prefs.txt,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
   list loadfile,list2,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
   
   list seek,list2,0
   %%match = @match(list2,DisplayModeWindowMode)
   if @equal(@item(list2),DisplayModeWindowMode @chr(34)1@chr(34))
   dialog set,check9,1
   end
   
   list seek,list2,0
   %%match = @match(list2,DisableTrilinearFiltering)
   if @equal(@item(list2),DisableTrilinearFiltering @chr(34)1@chr(34))
   dialog set,check10,1
   end
   
   list seek,list2,0
   %%match = @match(list2,Antialiasing)
    if @equal(@item(list2),Antialiasing @chr(34)0@chr(34))
   dialog set,check11,1
   end
   
    list seek,list2,0
   %%match = @match(list2,MipBias)
    if @equal(@item(list2),MipBias @chr(34)1.000000@chr(34))
   dialog set,check12,1
   end
   
    list seek,list2,0
   %%match = @match(list2,ShadowQuality)
    if @equal(@item(list2),ShadowQuality @chr(34)0@chr(34))
   dialog set,check13,1
   end
   
       list seek,list2,0
   %%match = @match(list2,PhysicsQuality)
    if @equal(@item(list2),PhysicsQuality @chr(34)0@chr(34))
   dialog set,check14,1
   end
   
       list seek,list2,0
   %%match = @match(list2,ClutterQuality)
    if @equal(@item(list2),ClutterQuality @chr(34)0@chr(34))
   dialog set,check15,1
   end
   
          list seek,list2,0
   %%match = @match(list2,HardwareClass)
    if @equal(@item(list2),HardwareClass @chr(34)1@chr(34))
    rem  dialog set,check16,1
   dialog disable,check16
   dialog hide,check16
   else
   dialog set,check16,""
  rem window send,@winexists(~check16)," "
   info Your hardware is not officially compatible. This software is provided AS IS"," I'm not responsible if you break your computer. @cr()@cr()If you want to play knowing this"," follow these steps. @cr()@cr()1. Check Force Hardware@cr()2. Launch the game @cr()@cr() It may work. If you get sound"," but only a black screen"," give up. If it says failed to start 3d"," give up. Unless this works"," give up"," or you really are on the path to breaking your computer.
   end
   
 
    %%k = @strdel(@winexists(@dlgtext()),1,1) 
LOADLIB user32.dll 
rem double buffer window
%%knockout = @lib(user32,SetWindowLongA,INT:,%%k,-20,INT: $2000000) 
FREELIB user32.dll 
 
    

    list loadtext,list1,
"CPU	Value	Dec++	Hex++
"0	1	1	1
"1	2	3	3
"2	4	7	7
"3	8	15	F
"4	16	31	1F
"5	32	63	3F
"6	64	127	7F
"7	128	255	FF
"
"Processor 0 VALUE + processor 2 VALUE = 0x05

  dialog disable,edit1
  rem wait event
  
  %%magich = @iniread(barheight,barheight)
  if @null(%%magich)
  %%magich = 38
  inifile write,barheight,barheight,38
  end
  
  %%magicw = @iniread(barw,barw)
  if @null(%%magicw)
  %%magicw = 16
  inifile write,barw,barw,16
  end
  
  %%prime = @iniread(directory,directory)
  
  if @null(%%prime)
  
  If @Win64()
   %%ask = @ask(Set directory to @chr(34)"C:\Program Files (x86)\Diablo III"@chr(34)?)
  if %%ask
  %%prime = c:\program files (x86)\Diablo III
    inifile write,directory,directory,%%prime
  else
  goto Set Directorymenu
  end
 else
  %%ask = @ask(Set directory to @chr(34)"C:\Program Files\Diablo III"@chr(34)?)
  if %%ask
  %%prime = c:\program files\Diablo III
    inifile write,directory,directory,%%prime
  else
  goto Set Directorymenu
  end
  
  end
  end
  
  random @datetime(hhnnss)
  
  
hotkey add,home,home
hotkey add,end,end

%%tack1 = -@name(@fdiv(%%magicw,2))
%%tack2 = -@diff(%%magich,@name(@fdiv(%%magicw,2)))
%%tack3 = @sum(@sysinfo(screenwidth),%%magicw)
%%tack4 = @sum(@sysinfo(screenheight),%%magich)

:evloop


if @winexists(diablo iii)

if @equal(%%ignore,true)
%%t = @winpos(diablo iii,t)
%%l = @winpos(diablo iii,l)
%%w = @winpos(diablo iii,w)
%%h = @winpos(diablo iii,h)
%%ignore = false
goto skipupdate
end

if @not(@equal(@winpos(diablo iii,s),2))
if @not(@equal(%%t,@winpos(diablo iii,t)))@not(@equal(%%l,@winpos(diablo iii,l)))@not(@equal(%%w,@winpos(diablo iii,w)))@not(@equal(%%h,@winpos(diablo iii,h)))
dialog set,text5,@diff(@winpos(diablo iii,w),%%magicw)x@diff(@winpos(diablo iii,h),%%magich)@cr()@diff(100,@name(@fmul(@fdiv(@fmul(@diff(@winpos(diablo iii,w),%%magicw),@diff(@winpos(diablo iii,h),%%magich)),@fmul(@sysinfo(screenwidth),@sysinfo(screenheight))),100)))"%" boost
dialog set,text10,@name(@fmul(@fdiv(@fdiv(@diff(@winpos(diablo iii,w),%%magicw),4),@fdiv(@diff(@winpos(diablo iii,h),%%magich),3)),100))"%"
dialog set,text12,@name(@fmul(@fdiv(@fdiv(@diff(@winpos(diablo iii,w),%%magicw),16),@fdiv(@diff(@winpos(diablo iii,h),%%magich),9)),100))"%"

%%t = @winpos(diablo iii,t)
%%l = @winpos(diablo iii,l)
%%w = @winpos(diablo iii,w)
%%h = @winpos(diablo iii,h)
end
end
:skipupdate
else
dialog set,text5,Window@cr()not open.
end

option errortrap,evloop


if @both(@numeric(@dlgtext(edit5)),@numeric(@dlgtext(edit6)))
if @equal(@wintext(~text13),+)
dialog set,edit2,@dlgtext(edit5)
dialog set,edit3,@fadd(@dlgtext(edit5),@dlgtext(edit6))
dialog set,text8,"% gain"
else
dialog set,edit3,@dlgtext(edit5)
dialog set,edit2,@fsub(@dlgtext(edit5),@dlgtext(edit6))
dialog set,text8,"% loss"
end
end


if @both(@numeric(@dlgtext(edit5b)),@numeric(@dlgtext(edit6b)))

if @equal(@wintext(~text13b),+)
dialog set,edit2b,@dlgtext(edit5b)
dialog set,edit3b,@fadd(@dlgtext(edit5b),@dlgtext(edit6b))
dialog set,text8b,"% gain"
else
dialog set,edit3b,@dlgtext(edit5b)
dialog set,edit2b,@fsub(@dlgtext(edit5b),@dlgtext(edit6b))
dialog set,text8b,"% loss"
end
end

if @both(@numeric(@dlgtext(edit2)),@numeric(@dlgtext(edit3)))
if @both(@not(@equal(@dlgtext(edit2),0)),@not(@equal(@dlgtext(edit3),0)))
dialog set,edit4,@diff(100,@name(@fmul(@fdiv(@dlgtext(edit2),@dlgtext(edit3)),100)))
end
end

if @both(@numeric(@dlgtext(edit2b)),@numeric(@dlgtext(edit3b)))
if @both(@not(@equal(@dlgtext(edit2b),0)),@not(@equal(@dlgtext(edit3b),0)))
dialog set,edit4b,@diff(100,@name(@fmul(@fdiv(@dlgtext(edit2b),@dlgtext(edit3b)),100)))
end
end

wait .1
%%event = @event()
if %%event
goto %%event
end

if @equal(%%hotkey,true)
%%mincount = @sum(%%mincount,3)

if @dlgtext(check1)
 window send,@winactive(),1
 end
wait .1
%%event = @event()
if %%event
goto %%event
end
if @dlgtext(check2)
 window send,@winactive(),2
 end
 wait .1

 %%event = @event()
if %%event
goto %%event
end
if @dlgtext(check3)
 window send,@winactive(),3
 end
 wait .1

 %%event = @event()
if %%event
goto %%event
end
if @dlgtext(check4)
 window send,@winactive(),4
 end
wait .1

%%event = @event()
if %%event
goto %%event
end
if @dlgtext(check5)
 window send,@winactive(),q
 end
wait .1
 %%event = @event()
if %%event
goto %%event
end

rem info @mousepos(x) - @winpos(@winactive(),L)
if @dlgtext(check6)
window rclick,@winactive(),@diff(@mousepos(x),@winpos(@winactive(),L)),@diff(@mousepos(y),@winpos(@winactive(),T))
end
wait .1
%%event = @event()
if %%event
goto %%event
end

if @dlgtext(check7)
window click,@winactive(),@diff(@mousepos(x),@winpos(@winactive(),L)),@diff(@mousepos(y),@winpos(@winactive(),T))
end
wait .1
%%event = @event()
if %%event
goto %%event
end


if @equal(%%mincount,60)
%%mincount = 0
if @dlgtext(scheck1)
 window send,@winactive(),1
 end
wait .1
%%event = @event()
if %%event
goto %%event
end
if @dlgtext(scheck2)
 window send,@winactive(),2
 end
 wait .1

 %%event = @event()
if %%event
goto %%event
end
if @dlgtext(scheck3)
 window send,@winactive(),3
 end
 wait .1

 %%event = @event()
if %%event
goto %%event
end
if @dlgtext(scheck4)
 window send,@winactive(),4
 end
wait .1

%%event = @event()
if %%event
goto %%event
end
if @dlgtext(scheck5)
 window send,@winactive(),q
 end
wait .1
 %%event = @event()
if %%event
goto %%event
end

rem info @mousepos(x) - @winpos(@winactive(),L)
if @dlgtext(scheck6)
window rclick,@winactive(),@diff(@mousepos(x),@winpos(@winactive(),L)),@diff(@mousepos(y),@winpos(@winactive(),T))
end
wait .1
%%event = @event()
if %%event
goto %%event
end

if @dlgtext(scheck7)
window click,@winactive(),@diff(@mousepos(x),@winpos(@winactive(),L)),@diff(@mousepos(y),@winpos(@winactive(),T))
end
wait .1
%%event = @event()
if %%event
goto %%event
end

end

end
goto evloop


:button2button
%%tack1 = @winpos(diablo iii,l)
%%tack2 = @winpos(diablo iii,t)
%%tack3 = @winpos(diablo iii,w)
%%tack4 = @winpos(diablo iii,h)
goto evloop

:button1button

if @equal(@dlgtext(edit1),"")
%%aff = ""
else
%%aff = " /affinity "@dlgtext(edit1)" "
end

%%pri = normal
if @dlgtext(check8)
%%pri = high
end
%%w = ""
if @dlgtext(check9)
%%w = -w
end
run cmd /C start @chr(34)d3@chr(34) %%aff /%%pri @chr(34)%%prime\Diablo III.exe@chr(34) %%w -launch
goto evloop

:button6button
if @not(@file(%%prime - Copy\Diablo III.exe))
%%ask = @ask(Second launch has not been setup yet. Would you like to do this now?)
if %%ask
%%ask = ""
goto setup/update second launchmenu
else
goto evloop
end
end

if @equal(@dlgtext(edit1),"")
%%aff = ""
else
%%aff = " /affinity "@dlgtext(edit1)" "
end

%%pri = normal
if @dlgtext(check8)
%%pri = high
end
%%w = ""
if @dlgtext(check9)
%%w = -w
end
run cmd /C start @chr(34)d3@chr(34) %%aff /%%pri @chr(34)%%prime - Copy\Diablo III.exe@chr(34) %%w -launch
goto evloop

:button4button
window position,diablo iii,,,@diff(@winpos(diablo iii,w),@name(@fdiv(@winpos(diablo iii,w),10))),
goto evloop

:button3button
rem window position,diablo iii,,,@sum(@winpos(diablo iii,w),@name(@fdiv(@winpos(diablo iii,w),10))),
%%tack1 = -@name(@fdiv(%%magicw,2))
%%tack2 = -@diff(%%magich,@name(@fdiv(%%magicw,2)))
%%tack3 = @sum(@sysinfo(screenwidth),%%magicw),
%%tack4 = @sum(@sysinfo(screenheight),%%magich)
goto evloop

:calibrate window bordersmenu
window position,diablo iii,,,800,600
%%magich = @diff(@winpos(diablo iii,h),600)
inifile write,barheight,barheight,%%magich
%%magicw = @diff(@winpos(diablo iii,w),800)
inifile write,barw,barw,%%magicw

%%tack1 = -@name(@fdiv(%%magicw,2))
%%tack2 = -@diff(%%magich,@name(@fdiv(%%magicw,2)))
%%tack3 = @sum(@sysinfo(screenwidth),%%magicw)
%%tack4 = @sum(@sysinfo(screenheight),%%magich)

goto evloop

:button5button
window position,diablo iii,,,,@sum(@winpos(diablo iii,h),@name(@fdiv(@winpos(diablo iii,h),10)))
goto evloop

:hotkey
%%hot = @hotkey()
if @equal(%%hot,home)
%%hotkey = true
else
%%hotkey = false
end
goto evloop

:close
exit

:start dwmmenu
runh net start @chr(34)Desktop Window Manager Session Manager@chr(34)
goto evloop

:kill dwmmenu
runh net stop @chr(34)Desktop Window Manager Session Manager@chr(34)
goto evloop

:start explorermenu
directory change,@windir()
runh explorer.exe
goto evloop

:kill explorermenu
runh taskkill /im explorer.exe /f
goto evloop

:button7button
info "Resize the window to establish a boost %. When you are happy click the <-Stretch-> button to go full screen with the boost, the numbers reported are for rendered window not window size."@cr()@cr()"IF YOU CAN'T MOVE the window then go to options and set the title bar height to 0 then click stretch."

rem info Boost do not take effect until you move/drag the window a little. If you want to maintain the current boost at a different size (stretch the window) do not move the window.
goto evloop

:button9button
:setup/update second launch (Robocopy)menu
run robocopy @chr(34)%%prime@chr(34) @chr(34)%%prime - Copy@chr(34) /E
goto evloop

:Remove Second Launchmenu
%%ask = @ask(Delete 2nd Launch?)
if %%ask
file delete,%%prime - Copy,Confirm,Allowundo,Showerrors
else
info Operation Aborted
end
goto evloop

:set directorymenu
%%prime = @dirdlg(Set Directory)
if @null(%%prime)
info Operation did not complete properly! Please relaunch the program.
inifile write,directory,directory,%%prime
stop
end
inifile write,directory,directory,%%prime
goto evloop

:button8button
run %%prime\Diablo III Launcher.exe
goto evloop

:button10button
info Items in this loop fire once every 20 seconds.
goto evloop

:button11button
info Items in this loop fire once every second.
goto evloop

:Search for Iobit Game Boostermenu
shell open,https://www.google.com/search?btnG=1&pws=0&q=iobit+game+booster
goto evloop

:button12button
info @text(list1)
info "Setting to first and second physical and unlocking option. If you did this by mistake, blank out the text box."
dialog enable,edit1
dialog set,edit1,0x05
goto evloop

:button13button
%%k = @strdel(@winexists(diablo iii),1,1) 
rem info @winpos(@winexists(~button1),l) @winpos(@winexists(~button1),t) 
LOADLIB user32.dll 
rem  %%SetWindowPos = @lib(user32.dll,SetWindowPos,INT:,%%k,0,-@name(@fdiv(%%magicw,2)),-@diff(%%magich,@name(@fdiv(%%magicw,2))),@sum(@sysinfo(screenwidth),%%magicw),@sum(@sysinfo(screenheight),@sum(%%magich,@name(@fdiv(%%magicw,2)))),$0040) 
%%SetWindowPos = @lib(user32.dll,SetWindowPos,INT:,%%k,0,%%tack1,%%tack2,%%tack3,%%tack4,$0040) 
rem @sum(@sysinfo(screenheight),@diff(@winpos(diablo iii,h),%%magich))
FREELIB user32.dll 
%%ignore = true
rem window position,diablo iii,0,0,@sysinfo(screenwidth),@sysinfo(screenheight)
goto evloop

:Height of window titlemenu
%%input = @input(Height please,@iniread(barheight,barheight))
if @numeric(%%input)
%%magich = %%input
inifile write,barheight,barheight,%%magich
end
goto evloop

:Width of window bordersmenu
%%input = @input(Width please,@iniread(barw,barw))
if @numeric(%%input)
%%magicw = %%input
inifile write,barw,barw,%%magicw
end




goto evloop

:ontop this sessionmenu
window ontop,Diablo III Helper
goto evloop

:TEXT13button
if @equal(@wintext(~text13),+)
dialog set,text13,-
else
dialog set,text13,+
end
goto evloop

:TEXT13bbutton
if @equal(@wintext(~text13b),+)
dialog set,text13b,-
else
dialog set,text13b,+
end
goto evloop

:CHECK10CLICK
list seek,list2,0
%%match = @match(list2,DisableTrilinearFiltering)
if @dlgtext(check10)
list put,list2,DisableTrilinearFiltering @chr(34)1@chr(34)
else
list put,list2,DisableTrilinearFiltering @chr(34)0@chr(34)
end
   if @greater(@sysinfo(winver),5.9)
   list savefile,list2,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   else
   list savefile,list2,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
goto evloop

:CHECK11CLICK
list seek,list2,0
%%match = @match(list2,Antialiasing)
if @dlgtext(check11)
list put,list2,Antialiasing @chr(34)0@chr(34)
else
list put,list2,Antialiasing @chr(34)1@chr(34)
end
   if @greater(@sysinfo(winver),5.9)
   list savefile,list2,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   else
   list savefile,list2,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
goto evloop

rem MipOffset "0"

:CHECK12CLICK
list seek,list2,0
%%match = @match(list2,MipBias)
if @dlgtext(check12)
list put,list2,MipBias @chr(34)1.000000@chr(34)
else
list put,list2,MipBias @chr(34)0.000000@chr(34)
end

list seek,list2,0
%%match = @match(list2,MipOffset)
if @dlgtext(check12)
list put,list2,MipOffset @chr(34)1@chr(34)
else
list put,list2,MipOffset @chr(34)0@chr(34)
end

   if @greater(@sysinfo(winver),5.9)
   list savefile,list2,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   else
   list savefile,list2,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
goto evloop

:CHECK13CLICK
list seek,list2,0
%%match = @match(list2,ShadowQuality)
if @dlgtext(check13)
list put,list2,ShadowQuality @chr(34)0@chr(34)
else
list put,list2,ShadowQuality @chr(34)3@chr(34)
end
   if @greater(@sysinfo(winver),5.9)
   list savefile,list2,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   else
   list savefile,list2,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
goto evloop

:CHECK14CLICK
list seek,list2,0
%%match = @match(list2,PhysicsQuality)
if @dlgtext(check14)
list put,list2,PhysicsQuality @chr(34)0@chr(34)
else
list put,list2,PhysicsQuality @chr(34)1@chr(34)
end
   if @greater(@sysinfo(winver),5.9)
   list savefile,list2,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   else
   list savefile,list2,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
goto evloop

:CHECK15CLICK
list seek,list2,0
%%match = @match(list2,ClutterQuality)
if @dlgtext(check15)
list put,list2,ClutterQuality @chr(34)0@chr(34)
else
list put,list2,ClutterQuality @chr(34)3@chr(34)
end
   if @greater(@sysinfo(winver),5.9)
   list savefile,list2,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   else
   list savefile,list2,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
goto evloop

:CHECK16CLICK
list seek,list2,0
%%match = @match(list2,HardwareClass)
list put,list2,HardwareClass @chr(34)1@chr(34)
list seek,list2,38
   if @greater(@sysinfo(winver),5.9)
   list savefile,list2,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   else
   list savefile,list2,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
goto evloop

:CHECK9CLICK
list seek,list2,0
%%match = @match(list2,DisplayModeWindowMode)
if @dlgtext(check9)
list put,list2,DisplayModeWindowMode @chr(34)1@chr(34)
else
list put,list2,DisplayModeWindowMode @chr(34)0@chr(34)
end

   if @greater(@sysinfo(winver),5.9)
   list savefile,list2,C:\Users\@env(username)\Documents\Diablo III\d3prefs.txt
   else
   list savefile,list2,C:\Documents and Settings\@env(username)\My Documents\Diablo III\d3prefs.txt
   end
goto evloop

#-----------------------------------------------------------------------------# 
#                                                                             # 
# A function that determines if you are using a 64bit version of windows.     # 
#                                                                             # 
# Author: Johnny Kinsey                                                       # 
#                                                                             # 
# Copyright: Copyright © 2007 DragonSphere Software                           # 
#                                                                             # 
#-----------------------------------------------------------------------------# 
:WIN64 
%R = 
%%MajorVersion = @SubStr(@SysInfo(WinVer),1,1) 
If @Greater(%%MajorVersion,4) 
  LoadLib kernel32.dll 
  %B = @BINARY(DWORD,0) 
  %H = @lib(kernel32,GetCurrentProcess,INT:) 
  %A = @lib(kernel32,IsWow64Process,BOOL,INT:%H,INT:@addr("%B")) 
  %B = @val(@substr(%B,1,4)) 
  If @Equal(%B,1) 
    %R = 1 
  End 
  FreeLib kernel32 
End 
Exit %R 
