uwe_baker

Keybinder

Sep 16th, 2014
549
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #SingleInstance, force
  2. #NoEnv
  3. #include overlay.ahk
  4. #include UDF.ahk
  5.  
  6. GetChatLine(Line, ByRef Output, timestamp=0, color=0)
  7. {
  8.     chatindex := 0
  9.     FileRead, file, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  10.     loop, Parse, file, `n, `r
  11.     {
  12.         if(A_LoopField)
  13.             chatindex := A_Index
  14.     }
  15.     loop, Parse, file, `n, `r
  16.     {
  17.         if(A_Index = chatindex - line){
  18.             output := A_LoopField
  19.             break
  20.         }
  21.     }
  22.     file := ""
  23.     if(!timestamp)
  24.         output := RegExReplace(output, "U)^\[\d{2}:\d{2}:\d{2}\]")
  25.     if(!color)
  26.         output := RegExReplace(output, "Ui)\{[a-f0-9]{6}\}")
  27.     return
  28. }
  29.  
  30. pfad = %A_MyDocuments%\GTA San Andreas User Files\Keybinder\optionen.txt
  31. pfad2 = %A_MyDocuments%\GTA San Andreas User Files\Keybinder
  32. ifnotexist %pfad%
  33. {
  34.     FileCreateDir, %pfad2%
  35.     iniwrite, 100, %pfad%, optionen, healx
  36.     iniwrite, 100, %pfad%, optionen, healy
  37.     iniwrite, 10, %pfad%, optionen, healsize
  38.     iniwrite, 200, %pfad%, optionen, clockx
  39.     iniwrite, 200, %pfad%, optionen, clocky
  40.     iniwrite, 10, %pfad%, optionen, clocksize
  41.     iniwrite, 300, %pfad%, optionen, zonex
  42.     iniwrite, 300, %pfad%, optionen, zoney
  43.     iniwrite, 10, %pfad%, optionen, zonesize
  44.     iniwrite, 400, %pfad%, optionen, wantedx
  45.     iniwrite, 400, %pfad%, optionen, wantedy
  46.     iniwrite, 450, %pfad%, optionen, wanted2x
  47.     iniwrite, 450, %pfad%, optionen, wanted2y
  48.     iniwrite, 500, %pfad%, optionen, wanted3x
  49.     iniwrite, 500, %pfad%, optionen, wanted3y
  50.     iniwrite, 10, %pfad%, optionen, wantedsize
  51.     MsgBox, Erstelle Ordner:`n`n'%pfad2%'`n`nErstelle Datei:`n`n`t'optionen.txt'`n`nPositionen wurden eingeschrieben.
  52.     iniread, healx, %pfad%, optionen, healx
  53.     iniread, healy, %pfad%, optionen, healy
  54.     iniread, healsize, %pfad%, optionen, healsize
  55.     iniread, clockx, %pfad%, optionen, clockx
  56.     iniread, clocky, %pfad%, optionen, clocky
  57.     iniread, clocksize, %pfad%, optionen, clocksize
  58.     iniread, zonex, %pfad%, optionen, zonex
  59.     iniread, zoney, %pfad%, optionen, zoney
  60.     iniread, zonesize, %pfad%, optionen, zonesize
  61.     iniread, wantedx, %pfad%, optionen, wantedx
  62.     iniread, wantedy, %pfad%, optionen, wantedy
  63.     iniread, wanted2x, %pfad%, optionen, wanted2x
  64.     iniread, wanted2y, %pfad%, optionen, wanted2y
  65.     iniread, wanted3x, %pfad%, optionen, wanted3x
  66.     iniread, wanted3y, %pfad%, optionen, wanted3y
  67.     iniread, wantedsize, %pfad%, optionen, wantedsize
  68. }
  69. else
  70. {
  71.     iniread, healx, %pfad%, optionen, healx
  72.     iniread, healy, %pfad%, optionen, healy
  73.     iniread, healsize, %pfad%, optionen, healsize
  74.     iniread, clockx, %pfad%, optionen, clockx
  75.     iniread, clocky, %pfad%, optionen, clocky
  76.     iniread, clocksize, %pfad%, optionen, clocksize
  77.     iniread, zonex, %pfad%, optionen, zonex
  78.     iniread, zoney, %pfad%, optionen, zoney
  79.     iniread, zonesize, %pfad%, optionen, zonesize
  80.     iniread, wantedx, %pfad%, optionen, wantedx
  81.     iniread, wantedy, %pfad%, optionen, wantedy
  82.     iniread, wanted2x, %pfad%, optionen, wanted2x
  83.     iniread, wanted2y, %pfad%, optionen, wanted2y
  84.     iniread, wanted3x, %pfad%, optionen, wanted3x
  85.     iniread, wanted3y, %pfad%, optionen, wanted3y
  86.     iniread, wantedsize, %pfad%, optionen, wantedsize
  87. }
  88.  
  89. SizeVar := 10
  90. healtext := -1
  91. healsetpos := 0
  92. healsetsize := 0
  93. clocktext := -1
  94. clocksetpos := 0
  95. clocksetsize := 0
  96. zonetext := -1
  97. zonesetpos := 0
  98. zonesetsize := 0
  99. wantedtext := -1
  100. wanted2text := -1
  101. wanted3text := -1
  102. wantedsetpos := 0
  103. wantedsetsize := 0
  104.  
  105. SetParam("use_window", "1")
  106. SetParam("window", "GTA:SA:MP")
  107. DestroyAllVisual()
  108. initZonesAndCities()
  109. Gui, Show, w200 h50, Keybinder
  110. SetTimer, Timer, 200
  111. SetTimer, FunctionTimer, 200
  112. SetTimer, HealTimer, 1000
  113. return
  114.  
  115. GuiClose:
  116. SetTimer, Timer, Off
  117. if(healtext != -1)
  118.     TextDestroy(healtext)
  119. if(clocktext != -1)
  120.     TextDestroy(clocktext)
  121. if(zonetext != -1)
  122.     TextDestroy(zonetext)
  123. if(wantedtext != -1)
  124.     TextDestroy(wantedtext)
  125. if(wanted2text != -1)
  126.     TextDestroy(wanted2text)
  127. if(wanted3text != -1)
  128.     TextDestroy(wanted3text)
  129. ExitApp
  130.  
  131. Timer:
  132. if(healsetpos == 1)
  133. {
  134.     MouseGetPos, x, y
  135.     TextSetPos(healtext, x, y)
  136.     GetKeyState, Fertig, LButton
  137.     if Fertig = D
  138.     {
  139.         KMSG("Heal Move Erfolgreich geaendert!")
  140.         iniwrite, %x%, %pfad%, optionen, healx
  141.         iniwrite, %y%, %pfad%, optionen, healy
  142.         if(healtext != -1)
  143.             TextDestroy(healtext)
  144.         iniread, healx, %pfad%, optionen, healx
  145.         iniread, healy, %pfad%, optionen, healy
  146.         healtext :=-1
  147.         healsetpos := 0
  148.         return
  149.     }
  150.     return
  151. }
  152. if(healsetsize == 1)
  153. {
  154.     GetKeyState, Plus, NumPadAdd
  155.     GetKeyState, Minus, NumPadSub
  156.     GetKeyState, Fertig, NumPadEnter
  157.     if Plus = D
  158.     {
  159.         SizeVar++
  160.         TextUpdate(healtext,Arial,SizeVar,false,false)
  161.     }
  162.     if Minus = D
  163.     {
  164.         SizeVar--
  165.         TextUpdate(healtext,Arial,SizeVar,false,false)
  166.     }  
  167.     if Fertig = D
  168.     {
  169.         KMSG("Heal Size Erfolgreich geaendert!")
  170.         iniwrite, %SizeVar%, %pfad%, optionen, healsize
  171.         SizeVar := 10
  172.         if(healtext != -1)
  173.             TextDestroy(healtext)
  174.         iniread, healx, %pfad%, optionen, healx
  175.         iniread, healy, %pfad%, optionen, healy
  176.         iniread, healsize, %pfad%, optionen, healsize
  177.         healtext :=-1
  178.         healsetpos := 0
  179.         healsetsize := 0
  180.     }
  181.     return
  182. }
  183. if(clocksetpos == 1)
  184. {
  185.     MouseGetPos, x, y
  186.     TextSetPos(clocktext, x, y)
  187.     GetKeyState, Fertig, LButton
  188.     if Fertig = D
  189.     {
  190.         KMSG("Clock Move Erfolgreich geaendert!")
  191.         iniwrite, %x%, %pfad%, optionen, clockx
  192.         iniwrite, %y%, %pfad%, optionen, clocky
  193.         if(clocktext != -1)
  194.             TextDestroy(clocktext)
  195.         iniread, clockx, %pfad%, optionen, clockx
  196.         iniread, clocky, %pfad%, optionen, clocky
  197.         clocktext :=-1
  198.         clocksetpos := 0
  199.         return
  200.     }
  201.     return
  202. }
  203. if(clocksetsize == 1)
  204. {
  205.     GetKeyState, Plus, NumPadAdd
  206.     GetKeyState, Minus, NumPadSub
  207.     GetKeyState, Fertig, NumPadEnter
  208.     if Plus = D
  209.     {
  210.         SizeVar++
  211.         TextUpdate(clocktext,Arial,SizeVar,false,false)
  212.     }
  213.     if Minus = D
  214.     {
  215.         SizeVar--
  216.         TextUpdate(clocktext,Arial,SizeVar,false,false)
  217.     }  
  218.     if Fertig = D
  219.     {
  220.         KMSG("Clock Size Erfolgreich geaendert!")
  221.         iniwrite, %SizeVar%, %pfad%, optionen, clocksize
  222.         SizeVar := 10
  223.         if(clocktext != -1)
  224.             TextDestroy(clocktext)
  225.         iniread, clockx, %pfad%, optionen, clockx
  226.         iniread, clocky, %pfad%, optionen, clocky
  227.         iniread, clocksize, %pfad%, optionen, clocksize
  228.         clocktext :=-1
  229.         clocksetpos := 0
  230.         clocksetsize := 0
  231.     }
  232.     return
  233. }
  234. if(zonesetpos == 1)
  235. {
  236.     MouseGetPos, x, y
  237.     TextSetPos(zonetext, x, y)
  238.     GetKeyState, Fertig, LButton
  239.     if Fertig = D
  240.     {
  241.         KMSG("Zone Move Erfolgreich geaendert!")
  242.         iniwrite, %x%, %pfad%, optionen, zonex
  243.         iniwrite, %y%, %pfad%, optionen, zoney
  244.         if(zonetext != -1)
  245.             TextDestroy(zonetext)
  246.         iniread, zonex, %pfad%, optionen, zonex
  247.         iniread, zoney, %pfad%, optionen, zoney
  248.         zonetext :=-1
  249.         zonesetpos := 0
  250.         return
  251.     }
  252.     return
  253. }
  254. if(zonesetsize == 1)
  255. {
  256.     GetKeyState, Plus, NumPadAdd
  257.     GetKeyState, Minus, NumPadSub
  258.     GetKeyState, Fertig, NumPadEnter
  259.     if Plus = D
  260.     {
  261.         SizeVar++
  262.         TextUpdate(zonetext,Arial,SizeVar,false,false)
  263.     }
  264.     if Minus = D
  265.     {
  266.         SizeVar--
  267.         TextUpdate(zonetext,Arial,SizeVar,false,false)
  268.     }  
  269.     if Fertig = D
  270.     {
  271.         KMSG("Zone Size Erfolgreich geaendert!")
  272.         iniwrite, %SizeVar%, %pfad%, optionen, zonesize
  273.         SizeVar := 10
  274.         if(zonetext != -1)
  275.             TextDestroy(zonetext)
  276.         iniread, zonex, %pfad%, optionen, zonex
  277.         iniread, zoney, %pfad%, optionen, zoney
  278.         iniread, zonesize, %pfad%, optionen, zonesize
  279.         zonetext :=-1
  280.         zonesetpos := 0
  281.         zonesetsize := 0
  282.     }
  283.     return
  284. }
  285. if(wantedsetpos == 1)
  286. {
  287.     MouseGetPos, x, y
  288.     TextSetPos(wantedtext, x, y)
  289.     TextSetPos(wanted2text, x, y+15)
  290.     TextSetPos(wanted3text, x, y+30)
  291.     GetKeyState, Fertig, LButton
  292.     if Fertig = D
  293.     {
  294.         KMSG("Wanted Move Erfolgreich geaendert!")
  295.         iniwrite, %x%, %pfad%, optionen, wantedx
  296.         iniwrite, %y%, %pfad%, optionen, wantedy
  297.         iniwrite, %x%, %pfad%, optionen, wanted2x
  298.         iniwrite, %y%, %pfad%, optionen, wanted2y
  299.         iniwrite, %x%, %pfad%, optionen, wanted3x
  300.         iniwrite, %y%, %pfad%, optionen, wanted3y
  301.         if(wantedtext != -1)
  302.             TextDestroy(wantedtext)
  303.         if(wanted2text != -1)
  304.             TextDestroy(wanted2text)
  305.         if(wanted3text != -1)
  306.             TextDestroy(wanted3text)
  307.         iniread, wantedx, %pfad%, optionen, wantedx
  308.         iniread, wantedy, %pfad%, optionen, wantedy
  309.         iniread, wanted2x, %pfad%, optionen, wanted2x
  310.         iniread, wanted2y, %pfad%, optionen, wanted2y
  311.         iniread, wanted3x, %pfad%, optionen, wanted3x
  312.         iniread, wanted3y, %pfad%, optionen, wanted3y
  313.         wantedtext :=-1
  314.         wanted2text :=-1
  315.         wanted3text :=-1
  316.         wantedsetpos := 0
  317.         return
  318.     }
  319.     return
  320. }
  321. if(wantedsetsize == 1)
  322. {
  323.     GetKeyState, Plus, NumPadAdd
  324.     GetKeyState, Minus, NumPadSub
  325.     GetKeyState, Fertig, NumPadEnter
  326.     if Plus = D
  327.     {
  328.         SizeVar++
  329.         TextUpdate(wantedtext,Arial,SizeVar,false,false)
  330.         TextUpdate(wanted2text,Arial,SizeVar,false,false)
  331.         TextUpdate(wanted3text,Arial,SizeVar,false,false)
  332.     }
  333.     if Minus = D
  334.     {
  335.         SizeVar--
  336.         TextUpdate(wantedtext,Arial,SizeVar,false,false)
  337.         TextUpdate(wanted2text,Arial,SizeVar,false,false)
  338.         TextUpdate(wanted3text,Arial,SizeVar,false,false)
  339.     }  
  340.     if Fertig = D
  341.     {
  342.         KMSG("wanted Size Erfolgreich geaendert!")
  343.         iniwrite, %SizeVar%, %pfad%, optionen, wantedsize
  344.         SizeVar := 10
  345.         if(wantedtext != -1)
  346.             TextDestroy(wantedtext)
  347.         if(wanted2text != -1)
  348.             TextDestroy(wanted2text)
  349.         if(wanted3text != -1)
  350.             TextDestroy(wanted3text)
  351.         iniread, wantedx, %pfad%, optionen, wantedx
  352.         iniread, wantedy, %pfad%, optionen, wantedy
  353.         iniread, wanted2x, %pfad%, optionen, wanted2x
  354.         iniread, wanted2y, %pfad%, optionen, wanted2y
  355.         iniread, wanted3x, %pfad%, optionen, wanted3x
  356.         iniread, wanted3y, %pfad%, optionen, wanted3y
  357.         iniread, wantedsize, %pfad%, optionen, wantedsize
  358.         wantedtext :=-1
  359.         wanted2text :=-1
  360.         wanted3text :=-1
  361.         wantedsetpos := 0
  362.         wantedsetsize := 0
  363.     }
  364.     return
  365. }
  366. if(healtext == -1)
  367.     healtext := TextCreate("Arial", healsize, false, false, healx, healy, 0xFFFFFFFF, "100", true, true)
  368.     TextSetShadow(healtext, false)
  369. if(healtext == -1)
  370.     return
  371. if(clocktext == -1)
  372.     clocktext := TextCreate("Arial", clocksize, false, false, clockx, clocky, 0xFFFFFFFF, "uhrzeit", true, true)
  373.     TextSetShadow(clocktext, false)
  374. if(clocktext == -1)
  375.     return
  376. if(zonetext == -1)
  377.     zonetext := TextCreate("Arial", zonesize, false, false, zonex, zoney, 0xFFFFFFFF, "zone", true, true)
  378.     TextSetShadow(zonetext, false)
  379. if(zonetext == -1)
  380.     return
  381. if(wantedtext == -1)
  382.     wantedtext := TextCreate("Arial", wantedsize, false, false, wantedx, wantedy, 0xFFFFFFFF, "wanted", true, true)
  383.     TextSetShadow(wantedtext, false)
  384. if(wantedtext == -1)
  385.     return
  386. if(wanted2text == -1)
  387.     wanted2text := TextCreate("Arial", wantedsize, false, false, wanted2x, wanted2y+15, 0xFFFFFFFF, "wanted2", true, true)
  388.     TextSetShadow(wanted2text, false)
  389. if(wanted2text == -1)
  390.     return
  391. if(wanted3text == -1)
  392.     wanted3text := TextCreate("Arial", wantedsize, false, false, wanted3x, wanted3y+30, 0xFFFFFFFF, "wanted3", true, true)
  393.     TextSetShadow(wanted3text, false)
  394. if(wanted3text == -1)
  395.     return
  396.  
  397. HP := GetPlayerHealth()
  398. if(HP < 47)
  399. {
  400.     HPFormat := "{FF2738}" . HP . " "
  401. }
  402. else
  403. {
  404.     HPFormat := "{FFFFFF}" . HP . " "
  405. }
  406. StringTrimRight, HPFormat, HPFormat, 4
  407. FormatTime, zeit,%A_Now%,HH:mm:ss
  408. Formattime, datum,%A_now%,dd.MM.yyyy
  409. GetPlayerPos(X,Y,Z)
  410. zone := calculateZone(X,Y,Z)
  411. if(TextSetString(healtext, HPFormat) == 0 || TextSetString(clocktext, " " . zeit . " - " . datum . " ") == 0 || TextSetString(zonetext, "" . zone . "") == 0)
  412. {
  413.     TextDestroy(healtext)  
  414.     healtext := -1
  415.     TextDestroy(clocktext) 
  416.     clocktext := -1
  417.     TextDestroy(zonetext)  
  418.     zonetext := -1
  419. }
  420. GetChatLine(1, chat1)
  421. if(InStr(chat1, "Du hast folgendes Verbrechen begangen"))
  422. {
  423.     RegExMatch(chat1, "Du hast folgendes Verbrechen begangen: \[(.*)\], Zeuge: (.*)" ,WantedReport)
  424. }
  425. GetChatLine(0, chat2)
  426. if(InStr(chat2, " * Aktuelles Wantedlevel:"))
  427. {
  428.     RegExMatch(chat2, " * Aktuelles Wantedlevel: (.*)" ,wlevel)
  429. }
  430. if(WantedReport1 == "")
  431. {
  432.     WantedReport1 := "Keiner"
  433. }
  434. if(WantedReport2 == "")
  435. {
  436.     WantedReport2 := "Keiner"
  437. }
  438. if(wlevel1 == "")
  439. {
  440.     wlevel1 := "0"
  441. }
  442. if(TextSetString(wantedtext, "Wantedlvl: " wlevel1 "") == 0 || TextSetString(wanted2text, "Grund: " WantedReport1 "") == 0 || TextSetString(wanted3text, "Cop: " WantedReport2 "") == 0)
  443. {
  444.     TextDestroy(wantedtext)
  445.     wantedtext := -1
  446.     TextDestroy(wanted2text)   
  447.     wanted2text := -1
  448.     TextDestroy(wanted3text)   
  449.     wanted3text := -1
  450. }
  451. return
  452.  
  453. FunctionTimer:
  454. {
  455.     GetChatLine(0, chat)
  456.     if(InStr(chat, "Connected. Joining the game..."))
  457.     {
  458.         KMSG("RGN - Daten werden synchronisiert ..")
  459.         sleep 2500
  460.     }
  461.     if(InStr(chat, "Connected to"))
  462.     {
  463.         FormatTime, zeit,%A_Now%,HH:mm:ss
  464.         FormatTime, tag,%A_Now%,dddd
  465.         KMSG("Willkommen " . getUsername() . " - Es ist " . tag . " " . zeit . "")
  466.         sleep 2500
  467.     }
  468.     if(InStr(chat, "/accept repair"))
  469.     {  
  470.         SendChat("/accept repair")
  471.         sleep 2500
  472.     }
  473.     if(InStr(chat, "/accept heal"))
  474.     {
  475.         SendChat("/accept heal")
  476.         sleep 2500
  477.     }
  478.     if(InStr(chat, "/accept refill"))
  479.     {
  480.         SendChat("/accept refill")
  481.         sleep 2500
  482.     }
  483.     if(InStr(chat, "/accept hotdog"))
  484.     {
  485.         SendChat("/accept hotdog")
  486.         sleep 2500
  487.     }
  488.     if(InStr(chat, "/accept sex"))
  489.     {
  490.         SendChat("/accept sex")
  491.         sleep 2500
  492.     }
  493.     ;Mats Point SF - /materials get 15
  494.     if(IsPlayerInRangeOfPoint(-1114.3662,-1621.3125,76.3739, 1.5))
  495.     {
  496.         SendChat("/materials get 15")
  497.         sleep 2500
  498.     }
  499.     ;Mats Point LV - /materials deliver
  500.     if(IsPlayerInRangeOfPoint(2470.9712,1905.9412,9.8582, 1.5))
  501.     {
  502.         SendChat("/materials deliver")
  503.         sleep 2500
  504.     }
  505.     ;Get Codes Point LV - /getcodes
  506.     if(IsPlayerInRangeOfPoint(212.4337,1822.7865,6.4141, 1.5))
  507.     {
  508.         SendChat("/getcodes")
  509.         sleep 2500
  510.     }
  511.     ;Decrypt Codes Point LV - /decrypt codes
  512.     if(IsPlayerInRangeOfPoint(-2498.9258,315.9062,29.2062, 1.5))
  513.     {
  514.         SendChat("/decrypt codes")
  515.         sleep 2500
  516.     }
  517.     ;Load Fish Point Bayside - /loadfish 500
  518.     if(IsPlayerInRangeOfPoint(-2457.2534,2293.0833,4.9844, 6))
  519.     {      
  520.         SendChat("/loadfish 500")
  521.         sleep 2500
  522.         GetChatLine(0, buychat1)
  523.         GetChatLine(1, buychat2)
  524.         if(InStr(buychat1, "[TRUCKER]: Du hast deinen"))
  525.         {
  526.             RegExMatch(buychat1, "U)\[TRUCKER\]: Du hast deinen Truck mit 500 Fischen für \$(.*) beladen. Truck Kapazität liegt bei 500/500.", buymoney)
  527.             AddChatMessage("{FFC100}INFO:")    
  528.             AddChatMessage("{FFFFFF}Du hast dir Fische um {FF2738}" buymoney1 "${FFFFFF} gekauft.")
  529.             kaufvar := buymoney1
  530.             buymoney1 := 0
  531.             sleep 500
  532.         }      
  533.         else if(InStr(buychat2, "[TRUCKER]: Du hast deinen"))
  534.         {
  535.             RegExMatch(buychat2, "U)\[TRUCKER\]: Du hast deinen Truck mit 500 Fischen für \$(.*) beladen. Truck Kapazität liegt bei 500/500.", buymoney) 
  536.             AddChatMessage("{FFC100}INFO:")    
  537.             AddChatMessage("{FFFFFF}Du hast dir Fische um {FF2738}" buymoney1 "${FFFFFF} gekauft.")
  538.             kaufvar := buymoney1
  539.             buymoney1 := 0
  540.             sleep 500
  541.         }
  542.         sleep 1000
  543.     }      
  544.     ;Sell Fish Point Truckerdepot - /sellfish 500
  545.     if(IsPlayerInRangeOfPoint(63.2327,-251.8377,1.5781, 7))
  546.     {
  547.         SendChat("/sellfish 500")
  548.         sleep 2500
  549.         GetChatLine(1, sellchat1)
  550.         GetChatLine(2, sellchat2)
  551.         if(InStr(sellchat1, "[TRUCKER]: Du hast 500"))
  552.         {
  553.             RegExMatch(sellchat1, "U)\[TRUCKER\]: Du hast 500 Fische ans Lager verkauft. Insgesamt \$(.*)\.", sellmoney)
  554.             AddChatMessage("{FFC100}INFO:")
  555.             AddChatMessage("{FFFFFF}Du hast dir Fische um {FF2738}" kaufvar "${FFFFFF} gekauft und fur {00FF38}" sellmoney1 "${FFFFFF} verkauft!")
  556.             sellvar := sellmoney1
  557.             sellmoney1 := 0
  558.             winmoney := sellvar - kaufvar      
  559.             AddChatMessage("{FFFFFF}Dein Gewinn: {00FF38}" winmoney "${FFFFFF}.")
  560.             gesamt += winmoney
  561.             AddChatMessage("{FFFFFF}-------------------------------------------------------------------")
  562.             AddChatMessage("{FFFFFF}Dein Tages Gewinn: {FFD200}" gesamt "${FFFFFF}.")
  563.             winmoney := 0
  564.             sleep 500
  565.         }
  566.         else if(InStr(sellchat2, "[TRUCKER]: Du hast 500"))
  567.         {
  568.             RegExMatch(sellchat2, "U)\[TRUCKER\]: Du hast 500 Fische ans Lager verkauft. Insgesamt \$(.*)\.", sellmoney)
  569.             AddChatMessage("{FFC100}INFO:")
  570.             AddChatMessage("{FFFFFF}Du hast dir Fische um {FF2738}" kaufvar "${FFFFFF} gekauft und fur {00FF38}" sellmoney1 "${FFFFFF} verkauft!")
  571.             sellvar := sellmoney1
  572.             sellmoney1 := 0
  573.             winmoney := sellvar - kaufvar      
  574.             AddChatMessage("{FFFFFF}Dein Gewinn: {00FF38}" winmoney "${FFFFFF}.")
  575.             gesamt += winmoney
  576.             AddChatMessage("{FFFFFF}-------------------------------------------------------------------")
  577.             AddChatMessage("{FFFFFF}Dein Tages Gewinn: {FFD200}" gesamt "${FFFFFF}.")
  578.             winmoney := 0
  579.             sleep 500
  580.         }
  581.         sleep 1000
  582.     }
  583. }
  584. return
  585.  
  586. HealTimer:
  587. heal := GetPlayerHealth()
  588. StringTrimRight, heal, heal, 3
  589. if (WinActive("GTA:SA:MP"))
  590. {
  591.     if(heal < oldheal AND oldheal)
  592.     {
  593.         healvar1 := heal
  594.         healvar2 := oldheal
  595.         endvar := healvar1-healvar2
  596.         if(endvar < -1)
  597.         {
  598.             KMSG("Du hast {FF2738}" endvar "{FFFFFF} HP verloren.")
  599.         }      
  600.     }
  601.     else if(heal > oldheal AND oldheal)
  602.     {
  603.         healvar1 := heal
  604.         healvar2 := oldheal
  605.         endvar := healvar1-healvar2
  606.         if(endvar > 1)
  607.         {
  608.             KMSG("Du hast {00FF38}+" endvar "{FFFFFF} HP bekommen.")
  609.         }
  610.     }
  611. }
  612. oldheal := heal
  613. return
  614.  
  615. #IfWinActive, GTA:SA:MP
  616.  
  617. Hotkey, Enter, Off
  618. Hotkey, Escape, Off
  619.  
  620. +T::
  621. ~t::
  622. Suspend On
  623. Hotkey, Enter, On
  624. Hotkey, Escape, On
  625. Hotkey, t, Off
  626. return
  627.  
  628. ~NumpadEnter::
  629. ~Enter::
  630. Suspend Permit
  631. Suspend Off
  632. Hotkey, t, On
  633. Hotkey, Enter, Off
  634. Hotkey, Escape, Off
  635. return
  636.  
  637. ~Escape::
  638. Suspend Permit
  639. Suspend Off
  640. Hotkey, t, On
  641. Hotkey, Enter, Off
  642. Hotkey, Escape, Off
  643. return
  644.  
  645. ;Keybinds
  646. sendIfPossible(str)
  647. {
  648.     if(isInChat())
  649.         return
  650.     SendChat(str)
  651. }
  652.  
  653. ~NumPadadd::sendIfPossible("/stats")
  654.  
  655. ~numpadsub::sendIfPossible("/time")
  656. ~^NumPad0::sendIfPossible("/carlock")
  657. ~!NumPad0::sendIfPossible("/lock")
  658. ~NumPad0::sendIfPossible("/engine")
  659. ~NumPad4::sendIfPossible("/lights")
  660.  
  661. ~NumPad7::
  662. sendIfPossible("/getdrugs 10")
  663. sendIfPossible("/getdrugs 10")
  664. sendIfPossible("/getdrugs 10")
  665. sendIfPossible("/getdrugs 10")
  666. return
  667.  
  668. numpad5::
  669. sendinput t/number{space}
  670. Suspend On
  671. Hotkey, Enter, On
  672. Hotkey, Escape, On
  673. return
  674.  
  675. n::
  676. sendinput t/notafk{space}
  677. Suspend On
  678. Hotkey, Enter, On
  679. Hotkey, Escape, On
  680. return
  681.  
  682. numpad6::
  683. sendinput t/id{space}
  684. Suspend On
  685. Hotkey, Enter, On
  686. Hotkey, Escape, On
  687. return
  688.  
  689. ~x::sendIfPossible("/exit")
  690. ~y::sendIfPossible("/enter")
  691.  
  692. !Numpad7::SendChat("/cargo")
  693. !Numpad8::SendChat("/opencargo")
  694. ^Numpad9::SendChat("/breakcargo")
  695.  
  696. !2::
  697. Suspend On
  698. SendInput t/get fuel{enter}
  699. Sleep 200
  700. SendInput t/fill{enter}
  701. Suspend Off
  702. return
  703.  
  704. :?:/find::
  705. Suspend Permit
  706. SendInput /find{space}
  707. Input,fID,V I M,{enter}
  708. KMSG("Find Timer {00FF38}gestartet!")
  709. loop
  710. {
  711.     SendChat("/find " fID)
  712.     KeyWait, < , D T7.5
  713.         If !ErrorLevel
  714.         {
  715.             KMSG("Find Timer {FF2738}gestoppt!")
  716.             return
  717.         }
  718. }
  719. return
  720.  
  721. :?:/showpos::
  722. Suspend Permit
  723. SendInput /showpos{space}
  724. Input,zID,V I M,{enter}
  725. KMSG("ShowPos-Find Timer {00FF38}gestartet!")
  726. loop
  727. {
  728.     SendChat("/showpos " zID)
  729.     KeyWait, < , D T7.5
  730.         If !ErrorLevel
  731.         {
  732.             KMSG("ShowPos-Find Timer {FF2738}gestoppt!")
  733.             return
  734.         }
  735. }
  736. return
  737.  
  738. :?:/setwantedlevel::
  739. Suspend Permit
  740. SendInput /id{space}
  741. Input,wlevel1,V I M,{enter}
  742. KMSG("Du hast dein WantedLevel auf " wlevel1 " gestellt!")
  743. wlevel1 := wlevel1
  744. return
  745.  
  746. !NumPad9::SendInput t{up}{enter}
  747.  
  748. :?:/ff::
  749. Suspend Permit
  750. SendInput /fastfood{space}{space}1{left}{left}
  751. return
  752.  
  753. :?:/eatd::
  754. Suspend Permit
  755. SendInput /eatdonut{enter}
  756. return
  757.  
  758. :?:/swh::
  759. suspend permit
  760. SendInput {enter}
  761. SendChat("/service wheelman")
  762. return
  763.  
  764. :?:/aheal::
  765. Suspend Permit
  766. SendInput /accept heal{enter}
  767. return
  768.  
  769. :?:/ahd::
  770. Suspend Permit
  771. SendInput /accept hotdog{enter}
  772. return
  773.  
  774. :?:/arep::
  775. Suspend Permit
  776. SendInput /accept repair{enter}
  777. return
  778.  
  779. :?:/aref::
  780. Suspend Permit
  781. SendInput /accept refill{enter}
  782. return
  783.  
  784. :?:/asex::
  785. Suspend Permit
  786. SendInput /accept sex{enter}
  787. return
  788.  
  789. :?:/re::
  790. suspend permit
  791. smsName := getUsername()
  792. Loop, read, %A_MyDocuments%\GTA San Andreas User Files\SAMP\chatlog.txt
  793. {
  794.     If InStr(A_LoopReadLine, "Sender:")
  795.     {
  796.         RegExMatch(A_LoopReadLine, "SMS: (.*), Sender: (.*) \((.*)\)" ,sms)
  797.     }
  798. }
  799. if(sms2 != smsName)
  800. {  
  801.     SendInput /sms %sms3%{space}
  802. }
  803. else
  804. {
  805.     sendinput, {enter}
  806. }
  807. return
  808.  
  809. ;Overlay
  810.  
  811. :?:/khelp::
  812. suspend permit
  813. SendInput {enter}
  814. KMSG("Hier siehst du nun alle Keybinder funktionen!")
  815. AddChatMessage("{FF5224}Overlay:")
  816. AddChatMessage("{FFFFFF} - Heal kannst du mit /healpos oder mit /healsize (Position o. Schriftgroesse) aendern!")
  817. AddChatMessage("{FFFFFF} - Clock kannst du mit /clockpos oder mit /clocksize (Position o. Schriftgroesse) aendern!")
  818. AddChatMessage("{FFFFFF} - Zone kannst du mit /zonepos oder mit /zonesize (Position o. Schriftgroesse) aendern!")
  819. AddChatMessage("{FFFFFF} - Wanted kannst du mit /wantedpos oder mit /wantedsize (Position o. Schriftgroesse) aendern!")
  820. return
  821.  
  822. :?:/healpos::
  823. suspend permit
  824. SendInput {enter}
  825. if(healsetpos == 1)
  826. {
  827.     KMSG("{FF9700}Heal Move ist schon aktiviert!")
  828.     return
  829. }
  830. if(healsetpos == 0)
  831. {
  832.     KMSG("Heal Move aktiviert!")
  833.     healsetpos := 1
  834.     return
  835. }
  836. return
  837.  
  838. :?:/healsize::
  839. suspend permit
  840. SendInput {enter}
  841. if(healsetsize == 1)
  842. {
  843.     KMSG("{FF9700}Heal Size ist schon aktiviert!")
  844.     return
  845. }
  846. if(healsetsize == 0)
  847. {
  848.     KMSG("Heal Size aktiviert!")
  849.     healsetsize := 1
  850.     return
  851. }
  852. return
  853.  
  854. :?:/clockpos::
  855. suspend permit
  856. SendInput {enter}
  857. if(clocksetpos == 1)
  858. {
  859.     KMSG("{FF9700}Clock Move ist schon aktiviert!")
  860.     return
  861. }
  862. if(clocksetpos == 0)
  863. {
  864.     KMSG("Clock Move aktiviert!")
  865.     clocksetpos := 1
  866.     return
  867. }
  868. return
  869.  
  870. :?:/clocksize::
  871. suspend permit
  872. SendInput {enter}
  873. if(clocksetsize == 1)
  874. {
  875.     KMSG("{FF9700}Clock Size ist schon aktiviert!")
  876.     return
  877. }
  878. if(clocksetsize == 0)
  879. {
  880.     KMSG("Clock Size aktiviert!")
  881.     clocksetsize := 1
  882.     return
  883. }
  884. return
  885.  
  886. :?:/zonepos::
  887. suspend permit
  888. SendInput {enter}
  889. if(zonesetpos == 1)
  890. {
  891.     KMSG("{FF9700}Zone Move ist schon aktiviert!")
  892.     return
  893. }
  894. if(zonesetpos == 0)
  895. {
  896.     KMSG("Zone Move aktiviert!")
  897.     zonesetpos := 1
  898.     return
  899. }
  900. return
  901.  
  902. :?:/zonesize::
  903. suspend permit
  904. SendInput {enter}
  905. if(zonesetsize == 1)
  906. {
  907.     KMSG("{FF9700}Zone Size ist schon aktiviert!")
  908.     return
  909. }
  910. if(zonesetsize == 0)
  911. {
  912.     KMSG("Zone Size aktiviert!")
  913.     zonesetsize := 1
  914.     return
  915. }
  916. return
  917.  
  918. :?:/wantedpos::
  919. suspend permit
  920. SendInput {enter}
  921. if(wantedsetpos == 1)
  922. {
  923.     KMSG("{FF9700}Wanted Move ist schon aktiviert!")
  924.     return
  925. }
  926. if(wantedsetpos == 0)
  927. {
  928.     KMSG("Wanted Move aktiviert!")
  929.     wantedsetpos := 1
  930.     return
  931. }
  932. return
  933.  
  934. :?:/wantedsize::
  935. suspend permit
  936. SendInput {enter}
  937. if(wantedsetsize == 1)
  938. {
  939.     KMSG("{FF9700}Wanted Size ist schon aktiviert!")
  940.     return
  941. }
  942. if(wantedsetsize == 0)
  943. {
  944.     KMSG("Wanted Size aktiviert!")
  945.     wantedsetsize := 1
  946.     return
  947. }
  948. return
  949.  
  950. KMSG(message)
  951. {
  952.     AddChatMessage("{8D8DFF}Keybinder: {FFFFFF}" message "")
  953. }
Advertisement
Add Comment
Please, Sign In to add comment