Jump to content

briancd2

Members
  • Posts

    6
  • Joined

  • Last visited

About briancd2

  • Birthday 01/07/1998

Profile Information

  • Location
    Alabama

Recent Profile Visitors

133 profile views

briancd2's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Not a good coder by any means, but the script works for basic needs. The script takes League of Legend (small server) tournament information (team names, ban picks, etc.) and put that information into a single message to be sent via the webhook as well as create an image grid with the champion bans included in it. It creates the message to send and saves it to my clipboard to paste it to our Discord server myself and it creates the PNG with the champion bans. I want to expedite this process and have the script send the message via the webhook and potentially the image as well if that's possible. The code isn't pretty. Sorry. #include <GDIPlus.au3> #include <ScreenCapture.au3> #include <WinAPI.au3> #include <GUIConstantsEx.au3> #include <WinHttp.au3> #include <WindowsConstants.au3> Func Webhook($Message) Local Const $sWebhookURL = "" Local Const $sJsonPayload = '{"content": "' & $Message & '"}' Local $oHTTP = ObjCreate("winhttp.winhttprequest.5.1") If IsObj($oHTTP) Then $oHTTP.Open("POST", $sWebhookURL) $oHTTP.SetRequestHeader("Content-Type", "application/json") $oHTTP.Send($sJsonPayload) If $oHTTP.Status = 204 Then ; 204 No Content indicates success for webhooks MsgBox(0, "Success", "Message sent successfully!") Else MsgBox(0, "Error", "Failed to send message. Status: " & $oHTTP.Status) EndIf Else MsgBox(0, "Error", "Failed to create WinHttp object.") EndIf EndFunc Opt("GUIOnEventMode", 1) Global $t1 = InputBox("Team Name", "What is the first team name?") Global $t2 = InputBox("Team Name", "What is the second team name?") Global $champs = "Aatrox|Ahri|Akali|Akshan|Alistar|Ambessa|Amumu|Anivia|Annie|Ashe|AurelionSol|Aurora|Azir|Bard|Belveth|Blitzcrank|Brand|Braum|Briar|Caitlyn|Camille|Cassiopeia|ChoGath|Corki|Darius|Diana|DrMundo|Draven|Ekko|Elise|Evelynn|Ezreal|Fiddlesticks|Fiora|Fizz|Galio|Gangplank|Garen|Gnar|Gragas|Graves|Gwen|Hecarim|Heimerdinger|Hwei|Illaoi|Irelia|Ivern|Janna|JarvanIV|Jax|Jayce|Jhin|Jinx|Kaisa|Kalista|Karma|Karthus|Kassadin|Katarina|Kayle|Kayn|Kennen|KhaZix|Kindred|Kled|KogMaw|Ksante|Leblanc|LeeSin|Leona|Lillia|Lissandra|Lucian|Lulu|Lux|Malphite|Malzahar|Maokai|MasterYi|Mel|Milio|MissFortune|Mordekaiser|Morgana|Naafiri|Nami|Nasus|Nautilus|Neeko|Nidalee|Nilah|Nocturne|Nunu|Olaf|Orianna|Ornn|Pantheon|Poppy|Pyke|Qiyana|Quinn|Rakan|Rammus|RekSai|Rell|Renata|Renekton|Rengar|Riven|Rumble|Ryze|Samira|Sejuani|Senna|Seraphine|Sett|Shaco|Shen|Shyvana|Singed|Sion|Sivir|Skarner|Smolder|Sona|Soraka|Swain|Sylas|Syndra|TahmKench|Taliyah|Talon|Taric|Teemo|Thresh|Tristana|Trundle|Tryndamere|TwistedFate|Twitch|Udyr|Urgot|Varus|Vayne|Veigar|VelKoz|Vex|Vi|Viego|Viktor|Vladimir|Volibear|Warwick|Wukong|Xayah|Xerath|XinZhao|Yasuo|Yone|Yorick|Yunara|Yuumi|Zac|Zed|Zeri|Ziggs|Zilean|Zoe|Zyra" Global $Message #Region (=== GUI generated by GuiBuilderPlus 1.2.0 ===) Global $hGUI, $GUI Global $Combo_1, $Combo_2, $Combo_3, $Combo_4, $Combo_5, $Combo_6, $Combo_7, $Combo_8, $Combo_9, $Combo_10 Global $Button_1 Func _guiCreate() $hGUI = GUICreate("Tournament Ban Picks", 290, 320, -1, -1) GUISetBkColor(0xC0C0C0) GUISetOnEvent($GUI_EVENT_CLOSE, "_onExitMain") $Label_1 = GUICtrlCreateLabel($t1 & " Bans", 15, 10, 86, 16) $Label_2 = GUICtrlCreateLabel($t2 & " Bans", 160, 10, 86, 16) $Combo_1 = GUICtrlCreateCombo("", 15, 30, 116, 20) GuiCtrlSetData(-1, $champs, "Aatrox") $Combo_2 = GUICtrlCreateCombo("", 15, 70, 116, 20) GuiCtrlSetData(-1, $champs, "Ahri") $Combo_3 = GUICtrlCreateCombo("", 15, 110, 116, 20) GuiCtrlSetData(-1, $champs, "Akali") $Combo_4 = GUICtrlCreateCombo("", 15, 150, 116, 20) GuiCtrlSetData(-1, $champs, "Akshan") $Combo_5 = GUICtrlCreateCombo("", 15, 190, 116, 20) GuiCtrlSetData(-1, $champs, "Alistar") $Combo_6 = GUICtrlCreateCombo("", 160, 30, 116, 20) GuiCtrlSetData(-1, $champs, "Ambessa") $Combo_7 = GUICtrlCreateCombo("", 160, 70, 116, 20) GuiCtrlSetData(-1, $champs, "Amumu") $Combo_8 = GUICtrlCreateCombo("", 160, 150, 116, 20) GuiCtrlSetData(-1, $champs, "Anivia") $Combo_9 = GUICtrlCreateCombo("", 160, 110, 116, 20) GuiCtrlSetData(-1, $champs, "Annie") $Combo_10 = GUICtrlCreateCombo("", 160, 190, 116, 20) GuiCtrlSetData(-1, $champs, "Ashe") $Button_1 = GUICtrlCreateButton("Generate Ban Pool", 70, 245, 151, 41) GUICtrlSetOnEvent($Button_1, "_onButton_1") EndFunc ;==>_guiCreate #EndRegion (=== GUI generated by GuiBuilderPlus 1.2.0 ===) _main() Func _main() _guiCreate() GUISetState(@SW_SHOWNORMAL) While 1 Sleep(100) WEnd EndFunc ;==>_main Func _onExitMain() GUIDelete() Exit EndFunc ;==>_onExitMain Func _onButton_1() GUISetState(@SW_DISABLE, $hGUI) $GUI = GUICreate("BanPool",780,315) Global $bans[10] = [GUICtrlRead($Combo_1), GUICtrlRead($Combo_2), GUICtrlRead($Combo_3), GUICtrlRead($Combo_4), GUICtrlRead($Combo_5), GUICtrlRead($Combo_6), GUICtrlRead($Combo_7), GUICtrlRead($Combo_8), GUICtrlRead($Combo_9), GUICtrlRead($Combo_10)] Local $left = 5 Local $top = 5 Local $u = 0 For $i in $bans $u = $u + 1 _GDIPlus_Startup() $image=_GDIPlus_ImageLoadFromFile("C:\Users\brian\Downloads\champion\" & $i & ".png") _GDIPlus_ImageSaveToFile($image,"image.jpg") _WinAPI_DeleteObject($image) If $u <= 5 Then If $i Then $top = 5 GUICtrlCreatePic("image.jpg", $left, $top) $left = $left + 155 EndIf ElseIf $u >= 6 Then If $u = 6 Then $left = 5 EndIf If $i Then $top = 160 GUICtrlCreatePic("image.jpg", $left, $top) $left = $left + 155 EndIf EndIf Next GUISetState(@SW_SHOWNORMAL, $GUI) GUISetOnEvent($GUI_EVENT_CLOSE, Finish) EndFunc ;==>_onButton_1 Func Finish() FileDelete("C:\Users\brian\Pictures\BanList.png") _ScreenCapture_CaptureWnd ("C:\Users\brian\Pictures\BanList.png", $GUI ,0 ,26 ,-1 ,-1 ,False) _GDIPlus_Shutdown() Webhook("```" & $t1 & " Ban Picks:" & @CRLF & $bans[0] & ", " & $bans[1] & ", " & $bans[2] & ", " & $bans[3] & ", "& $bans[4] & "!```" & @CRLF & "```" & $t2 & " Ban Picks:" & @CRLF & $bans[5] & ", " & $bans[6] & ", " & $bans[7] & ", " & $bans[8] & ", "& $bans[9] & "!```") ClipPut("```" & $t1 & " Ban Picks:" & @CRLF & $bans[0] & ", " & $bans[1] & ", " & $bans[2] & ", " & $bans[3] & ", "& $bans[4] & "!```" & @CRLF & "```" & $t2 & " Ban Picks:" & @CRLF & $bans[5] & ", " & $bans[6] & ", " & $bans[7] & ", " & $bans[8] & ", "& $bans[9] & "!```") GUIDelete($GUI) WinActivate($hGUI) GUISetState(@SW_ENABLE, $hGUI) EndFunc
  2. ​It's not game automation (literally opens a msgbox for each button; nothing else). It's clearly a helpful tool with information regarding what rewards are located in a specific place that anyone can go to. The information can be accessed through the game's wiki as well. This tool was only made to make the process of getting this information faster. Thank you though.
  3. I honestly can't seem to figure out why this isn't working; however, I just learned about making a Gui and I wasn't very good at autoit initially. If someone could explain it or even clean it up, I'd be grateful. I didn't see the point in adding all the other functions yet considering that the 2 I had weren't working. #include <GuiConstantsEx.au3> GUI() Func GUI() Opt("GUIOnEventMode", 1) Opt("GUICoordMode", 1) GUICreate("BabyPandaDGAF's Wonderful Creation", 600, 475) GUISetOnEvent($GUI_EVENT_CLOSE, "Close") GUISetState() ;First Column GUICtrlCreateButton("Tower 1 Capture", 0, 0, 150, 68) GUISetOnEvent(-1, "T1C") GUICtrlCreateButton("Tower 1 Defense", 0, 68, 150, 68) GUISetOnEvent(-1, "T1D") GUICtrlCreateButton("Tower 1 Exterminate", 0, 136, 150, 68) GUISetOnEvent(-1, "T1E") GUICtrlCreateButton("Tower 1 Interception", 0, 204, 150, 68) GUISetOnEvent(-1, "T1I") GUICtrlCreateButton("Tower 1 Mobile Defense", 0, 272, 150, 68) GUISetOnEvent(-1, "T1MD") GUICtrlCreateButton("Tower 1 Sabotage", 0, 340, 150, 68) GUISetOnEvent(-1, "T1Sa") GUICtrlCreateButton("Tower 1 Survival", 0, 408, 150, 68) GUISetOnEvent(-1, "T1S") ; Second Column GUICtrlCreateButton("Tower 2 Capture", 150, 0, 150, 68) GUISetOnEvent(-1, "T2C") GUICtrlCreateButton("Tower 2 Defense", 150, 68, 150, 68) GUISetOnEvent(-1, "T2D") GUICtrlCreateButton("Tower 2 Exterminate", 150, 136, 150, 68) GUISetOnEvent(-1, "T2E") GUICtrlCreateButton("Tower 2 Interception", 150, 204, 150, 68) GUISetOnEvent(-1, "T2I") GUICtrlCreateButton("Tower 2 Mobile Defense", 150, 272, 150, 68) GUISetOnEvent(-1, "T2MD") GUICtrlCreateButton("Tower 2 Sabotage", 150, 340, 150, 68) GUISetOnEvent(-1, "T2Sa") GUICtrlCreateButton("Tower 2 Survival", 150, 408, 150, 68) GUISetOnEvent(-1, "T2S") ; Third Column GUICtrlCreateButton("Tower 3 Capture", 300, 0, 150, 68) GUISetOnEvent(-1, "T3C") GUICtrlCreateButton("Tower 3 Defense", 300, 68, 150, 68) GUISetOnEvent(-1, "T3D") GUICtrlCreateButton("Tower 3 Exterminate", 300, 136, 150, 68) GUISetOnEvent(-1, "T3E") GUICtrlCreateButton("Tower 3 Interception", 300, 204, 150, 68) GUISetOnEvent(-1, "T3I") GUICtrlCreateButton("Tower 3 Mobile Defense", 300, 272, 150, 68) GUISetOnEvent(-1, "T3MD") GUICtrlCreateButton("Tower 3 Sabotage", 300, 340, 150, 68) GUISetOnEvent(-1, "T3Sa") GUICtrlCreateButton("Tower 3 Survival", 300, 408, 150, 68) GUISetOnEvent(-1, "T3S") ; Fourth Column GUICtrlCreateButton("Tower 4 Capture", 450, 0, 150, 68) GUISetOnEvent(-1, "T4C") GUICtrlCreateButton("Tower 4 Defense", 450, 68, 150, 68) GUISetOnEvent(-1, "T4D") GUICtrlCreateButton("Tower 4 Exterminate", 450, 136, 150, 68) GUISetOnEvent(-1, "T4E") GUICtrlCreateButton("Tower 4 Interception", 450, 204, 150, 68) GUISetOnEvent(-1, "T4I") GUICtrlCreateButton("Tower 4 Mobile Defense", 450, 272, 150, 68) GUISetOnEvent(-1, "T4MD") GUICtrlCreateButton("Tower 4 Sabotage", 450, 340, 150, 68) GUISetOnEvent(-1, "T4Sa") GUICtrlCreateButton("Tower 4 Survival", 450, 408, 150, 68) GUISetOnEvent(-1, "T4S") While 1 Sleep(100) WEnd EndFunc Func T1C() MsgBox(0, "Tower 1 Capture Rewards", "Boar Prime Receiver" & @CRLF & "Lex Prime Receiver" & @CRLF & "Paris Prime Grip" & @CRLF & "Forma Blueprint" & @CRLF & "Odonata Prime Blueprint" & @CRLF & "Void Key" & @CRLF & "Fusion Core") EndFunc Func T1D() MsgBox(0, "Tower 1 Defense Rewards", "Rotation A: Forma Blueprint, Fusion Core, Orokin Cell, and Void Key") EndFunc Func Close() Exit 0 EndFunc
  4. Whenever I make a new script for anything, it's usually just to replace my own original method of doing things. The auto-clicker was me attempting to make something that could replace my other clicker even though I could have just easily downloaded another. Most scripts I make are for enjoyment; however, I originally wanted to learn Java and gave up on it pretty fast, so I see this as a gateway to simple coding.
  5. I looked at what you showed me and I couldn't relate it to what I was attempting to do, but I found out how to fix my problem. I actually feel very dumb right now. Func Bind() MsgBox(0, "Welcome", "F6 to pause. F7 to end the program. F8 to start. F9 to open this window.") EndFunc Func Terminate() Exit 0 EndFunc Func Pause() MsgBox(0,"Pause", "Press Ok when you're ready to resume.") Sleep(1500) EndFunc Func Begin() While 1 MouseClick("") WEnd EndFunc HotKeySet("{F6}", "Pause") HotKeySet("{F7}", "Terminate") HotKeySet("{F8}", "Begin") HotKeySet("{F9}", "Bind") Bind() While 1 Sleep(1) WEnd
  6. I'm brand new to coding, always been fascinated with it, and I can't seem to get this auto-clicker to work for me. Whenever I try to run the code, it gives me an error for lines 9 and 29. MsgBox(0, "Welcome", "This program was made by briancd2.") Func Change() Global $clicker = InputBox("", "How many clicks would you like to send?", "100") Global $switch = InputBox("", "Left(1) or Right(2) click?", "2") EndFunc Func hotkeys() MsgBox(0, "Hotkeys", "Press F6 to pause. Press F7 to begin. F8 to end the program. F9 to change clicks and right/left click. F10 to reopen this." EndFunc If Change() = True Then begin() EndIf hotkeys() If $switch = 1 Then $switcher = "left" ElseIf $switch = 2 Then $switcher = "right" Else $switch > 2 Then MsgBox(0, "", "Change your click to Left(1) or Right(2).") Change() EndIf Func click() MouseClick($switch,(,($clicker,(0)))) Sleep(500) change() EndFunc Func begin() While 1 click() WEnd EndFunc Func Terminate() Exit 0 EndFunc Func Pause() MsgBox(0,"Pause", "Press Ok when you're ready to resume.") Sleep(1500) EndFunc HotKeySet("{F7}", "begin") HotKeySet("{F8}", "Terminate") HotKeySet("{F6}","Pause") HotKeySet("{F9}", "change") HotKeySet("{F10}", "hotKey") While 1 Sleep(1) WEnd I honestly have no idea what I've done wrong; however, this is one of the only scripts I've made, so I wouldn't know what was wrong anyways.
×
×
  • Create New...