Advertisement
Guest User

GTAssistant

a guest
Jan 3rd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Include "gtassistant.bi"
  2.  
  3.  
  4. dim as FB.IMAGE ptr Arial(191),ArialRed(191)
  5. dim as FB.IMAGE ptr GTA(191)
  6.  
  7. Dim As Integer count,id,scroll,renderthreads,quitkey,mx,my,mwheel,mbutton,key,mblurt,selid,iselector,linecount
  8. Dim As String modname(1000),modauthor(1000),modtags(1000),ids,keys,lfilter,linebuffer,launcherpath
  9. ScreenRes 200,300,32,,8 Or &h20
  10. ChDir ExePath
  11. Kill ExePath+"/list.txt"
  12. Kill "list.txt"
  13. count = 21
  14. iselector = -1
  15. gfx.font.loadttf( "#arial.ttf",Arial(count),,,count )
  16. gfx.font.loadttf( "GTA.ttf",GTA(36),,,36 )
  17.  
  18. draw string (12,120), "GTAssistant", ,GTA(36), Alpha
  19. draw string (70,200), "Loading...", ,Arial(21), Alpha
  20. draw string (10,280), "Made by PexingYT", ,Arial(21), Alpha
  21.  
  22. Print "Cleaning up cache..."
  23. Do
  24.     Print Dir()
  25.     count=count + 1
  26.     sleep
  27. Loop Until count >= 100
  28. sleep
  29. count = 0
  30.  
  31.  
  32.  
  33. lfilter = "GTAVLauncher (GTAVLauncher.EXE)" + Chr(0) + "GTAVLauncher.EXE" + Chr(0, 0)
  34. ChDir Exepath
  35. Name("list.txt","oldlist.txt")
  36. Sleep 1000,1
  37. downloadfromweb("http://loudplay.de/gtasisstant/mods/list.txt",ExePath+"/list.txt")
  38. Print ExePath
  39.  
  40. If FileExists(ExePath+"/gtalauncher.txt") Then
  41.     Print "Launcher found"
  42.     Open ExePath+"/gtalauncher.txt" For Input As #2
  43.     Line Input #2, launcherpath
  44.     Close #2
  45. Else
  46.     launcherpath = LoadSaveDialog(0,lfilter,0,"C:/","")
  47.     Open ExePath+"/gtalauncher.txt" For Output As #2
  48.     Print #2, launcherpath
  49.     Close #2
  50. EndIf
  51.  
  52.  
  53. ChDir ExePath
  54. count = 0
  55. Do
  56.     count = count + 2
  57.     gfx.font.loadttf( "#arial.ttf",Arial(count),,,count )
  58.     Sleep 1,1
  59. Loop Until count >=92
  60. count = 0
  61. Do
  62.     count = count + 2
  63.     gfx.font.loadttf( "#arial.ttf",ArialRed(count),,,count,RGB(255,0,0) )
  64.     Sleep 1,1
  65. Loop Until count >=92
  66.  
  67. count = 0
  68. Do
  69.     count = count + 2
  70.     gfx.font.loadttf( "GTA.ttf",GTA(count),,,count )
  71.     Sleep 1,1
  72. Loop Until count >=92
  73.  
  74. ScreenRes 1280,720,32,,&h20
  75. renderthreads = 90
  76. Do
  77.     GetMouse (mx,my,mwheel,mbutton)
  78.     If mwheel > 0 Then
  79.         mwheel = 0
  80.     EndIf
  81.     If mx>0 Then
  82.         scroll = mwheel * 20
  83.     End If
  84.    
  85.    
  86.     ScreenLock
  87.     If mblurt = 2 Then
  88.         mblurt = 0
  89.         Line(0,61)-(399,720),RGB(0,0,0),BF
  90.         If iselector <> -1 Then
  91.             Line(0,(id*100+iselector+60)-100)-(400,iselector*100+scroll+60),RGB(40,40,60),BF
  92.         EndIf
  93.     EndIf
  94.     Open "list.txt" For Input As #4
  95.     Do
  96.         Line Input #4, ids
  97.         id = Val(ids)
  98.         Line Input #4, modname(id)
  99.         Line Input #4, modauthor(id)
  100.         Line Input #4, modtags(id)
  101.         Line(0,id*100+scroll+60)-(400,id*100+scroll+60),RGB(40,40,60)
  102.         draw string (5,(id*100+scroll+60)-100), modname(id), ,GTA(40), Alpha
  103.         draw string (5,(id*100+scroll+60)-68), modauthor(id), ,GTA(22), Alpha
  104.         draw string (5,(id*100+scroll+60)-22), modtags(id), ,GTA(24), Alpha
  105.     Loop Until Eof(4) Or id*100+scroll*20>720
  106.    
  107.     Line(0,60)-(1280,60),RGB(255,255,255)
  108.     If renderthreads = 90 Then
  109.         Line(401,61)-(1280,720),RGB(0,0,0),BF
  110.         If iselector <> -1 Then
  111.             Line(0,(id*100+iselector+60)-100)-(400,iselector*100+scroll+60),RGB(100,100,100),BF
  112.             draw string (410,60), modname(iselector), ,GTA(60), Alpha
  113.             draw string (5,(id*100+scroll+60)-100), modname(id), ,GTA(40), Alpha
  114.             draw string (5,(id*100+scroll+60)-68), modauthor(id), ,GTA(22), Alpha
  115.             draw string (5,(id*100+scroll+60)-22), modtags(id), ,GTA(24), Alpha
  116.             ChDir ExePath
  117.             draw string (410,115+linecount*21), "Downloading info from Server...", &hFF0000,Arial(20), Alpha
  118.             Kill Str(iselector)+".desc.txt"
  119.             DownloadFile("http://loudplay.de/gtasisstant/mods/"+Str(iselector)+"/desc.txt",Str(iselector)+".desc.txt")
  120.             Kill Str(iselector)+".requirements.txt"
  121.             DownloadFile("http://loudplay.de/gtasisstant/mods/"+Str(iselector)+"/requirements.txt",Str(iselector)+".requirements.txt")
  122.             Open Str(iselector)+".desc.txt" For Input As #1
  123.             Open Str(iselector)+".requirements.txt" For Input As #2
  124.             linecount = 0
  125.             linebuffer = ""
  126.             Line(401,61)-(1280,720),RGB(0,0,0),BF
  127.             draw string (410,60), modname(iselector), ,GTA(60), Alpha
  128.             Do
  129.                 Line Input #1, linebuffer
  130.                 draw string (410,115+linecount*21), linebuffer, ,Arial(20), Alpha
  131.                 linecount = linecount + 1
  132.             Loop Until Eof(1)
  133.            
  134.             linecount = linecount + 1
  135.             linebuffer = ""
  136.             Do
  137.                 Line Input #2, linebuffer
  138.                 draw string (410,115+linecount*21), linebuffer,&hFF0000,ArialRed(20), Alpha
  139.                 linecount = linecount + 1
  140.             Loop Until Eof(2)
  141.             Close #1
  142.             Close #2
  143.             draw string (1040,670), "Play with Mod", ,GTA(40), Alpha
  144.            
  145.         EndIf
  146.         Line(0,0)-(1280,59),RGB(0,0,0),BF
  147.         draw string (480,-18), "GTAssistant", ,GTA(80), Alpha
  148.         renderthreads = 0
  149.     Else
  150.         Line(0,0)-(400,59),RGB(0,0,0),BF
  151.     End if
  152.     Line(400,60)-(400,720),RGB(255,255,255)
  153.    
  154.     If mbutton = 1 Then
  155.         If mx<401 And mx>-1 Then
  156.             selid = Val(Mid(Str((my-60-scroll)/100),1,1))
  157.             selid = selid + 1
  158.             If modname(selid) <> "" Then
  159.                 iselector = selid
  160.                 renderthreads = 89
  161.             EndIf
  162.         End If
  163.        
  164.         If mx>1039 And my>669 And mx<1280 And my<720 And mbutton = 1 And iselector <> -1 Then
  165.             LaunchMod(iselector,launcherpath)
  166.         EndIf
  167.        
  168.     EndIf
  169.    
  170.     Close #4
  171.     ScreenUnLock
  172.     keys=InKey()
  173.    
  174.     If keys = Chr(255)+"k" Then
  175.         quitkey = 1
  176.     EndIf
  177.    
  178.     Sleep 1,1
  179.    
  180.     renderthreads = renderthreads + 1
  181.     mblurt = mblurt + 1
  182. Loop Until quitkey = 1
  183. ChDir exepath
  184. Kill "list.txt"
  185. Open "list.txt" For Output As #2
  186. Print #2, ""
  187. Close #2
  188. Kill "list.txt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement