Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #SingleInstance Force
- global speed = 2 ;script speed modifiers
- global speed2 := speed/2
- ssearchx=200 ;location where to search for button images
- ssearchy=300 ;s - start, e - end
- esearchx=900
- esearchy=800
- xoffset=0 ;offset search rectangle position
- yoffset=0
- windowcheck=0 ;do check for location of a window?
- if windowcheck
- {
- sleep 5000 ;delay after starting script
- ImageSearch winlocx, winlocy, 0, 0, %A_ScreenWidth%, %A_ScreenHeight%,*70 x.png
- if ErrorLevel = 0 ;will look for the X button on window top rightmost corner
- {
- tooltip Window location offset point found here: %winlocx% %winlocy%, winlocx, winlocy
- yoffset:=winlocy-10 ;y coordinate offset
- sleep 100*speed
- }
- tooltip ;clean tooltip
- sleep 100
- Tooltip Will look for buttons here:
- ssearchx+=xoffset
- ssearchy+=yoffset
- esearchx+=xoffset
- esearchy+=yoffset
- tooltip %ssearchx% %ssearchy%, ssearchx, ssearchy, 2 ;positions indicating tooltips on top left and bottom right of search rectangle
- tooltip %esearchx% %esearchy%, esearchx, esearchy, 3
- sleep 500*speed
- }
- sleep 1000 ;===delete
- integerr = 0 ;champion name array index
- integerr2 = 0 ;next champion if previous failed
- champname := ["talon", "leblanc", "amumu", "illaoi", "singed", "swain", "ziggs", "mordekaiser"] ;few champion name list
- ncx=102 ;nextchampx ;pixel offset to next champion on line
- ncy=96 ;nextchampy ;pixel offset to next champion on the row
- ycx=0 ;yourchampx ;select champion to play, outdated
- ycy=0 ;yourchampy
- bcx=0 ;banchampx ;select champion to ban, outdated
- bcy=0 ;banchampy
- again:
- If ProcessExist("League of Legends.exe") ;functions within the game, disables other things
- {
- ImageSearch x, y, ssearchx, ssearchy, esearchx, esearchy+200,*30 q.png ;singed poison on
- if ErrorLevel = 0
- {
- Random beeprnd, 800, 900
- SoundBeep beeprnd, 25 ;make aditional sound
- }
- sleep 25
- goto again
- }
- if (A_TimeIdlePhysical < 5000) ;sleep the script if user interacts
- {
- tooltip
- sleep 4000
- goto again
- }
- ToolTip, Waiting for a game
- sleep 1000
- state=0 ;initiate state
- Sleep 100
- state = 1 ;accept the game
- Tooltip %state%
- ImageSearch x, y, ssearchx, ssearchy, esearchx, esearchy,*30 accep.png ;find flashy accept button
- if ErrorLevel = 0
- goto found
- state = 2 ;ban a champ
- Tooltip %state% %name%
- integerr = 1 ;odd
- cnrx=%bcx% ;set champion number, outdated
- cnry=%bcy%
- ImageSearch x, y, ssearchx, ssearchy, esearchx, esearchy,*30 banned.png ;look for grey ban button
- if ErrorLevel = 0
- goto found
- state = 3 ;lock in your champion
- integerr = 0 ;even
- Tooltip %state% %name%
- cnrx=%ycx% ;set champion number, outdated
- cnry=%ycy%
- ImageSearch x, y, ssearchx, ssearchy, esearchx, esearchy,*30 selec.png ;look for grey lock in button
- if ErrorLevel != 0
- goto again
- found: ;perform actions for found state
- tooltip Found %state%
- sleep 500
- Random, rand, 1, 1000
- sleep %rand%
- sleep 100
- if (A_TimeIdlePhysical < 5000) ;if user is active, do nothing
- {
- sleep 4000
- goto again
- }
- if (state>1) ;if a champion selection
- {
- txtx:=x+150 ;textfield location offset if window check was used
- txty:=y-515
- tooltip txtx txty are %txtx% and %txty%
- message=state2clicktxt
- MouseMove, txtx, txty, 2
- sleep 100*speed
- myclick(txtx, txty, message) ;click function on textfield
- sleep 100*speed
- tooltip send %name%
- sleep 1000
- integerr3:=integerr+integerr2
- thetext := champname[integerr3]
- tooltip % thetext
- typetext(thetext) ;types in the champion name
- integerr2 += 2 ;in case it fails, advance to other bannable champion on list
- champx:=x-270 ;outdated
- champy:=y-460 ;outdated
- sleep 100*speed
- tooltip myclick champx bcx cnrx champy bcy cnry myclick %champx% %bcx% %cnrx% %champy% %bcy% %cnry%
- sleep 300*speed
- message=state2clickchamp
- ;myclick(champx+(cnrx*ncx),champy+(cnry*ncy),message) ;click on champion, outdated
- myclick(x,y,message) ;click on champion
- sleep 300*speed
- ;ban and lock in
- }
- ;=======OUTDATED======;
- {
- ;~ if (state=3)
- ;~ {
- ;~ txtx:=x+160
- ;~ txty:=y-515
- ;~ tooltip txtx txty are %txtx% and %txty%
- ;~ message=state2clicktxt
- ;~ MouseMove, txtx, txty, 2
- ;~ sleep 100*speed
- ;~ myclick(txtx, txty, message)
- ;~ sleep 100*speed
- ;~ tooltip send si
- ;~ SendRaw si
- ;~ champx:=x-260
- ;~ champy:=y-460
- ;~ sleep 100*speed
- ;~ tooltip myclick champx bcx cnrx champy bcy cnry myclick %champx% %bcx% %cnrx% %champy% %bcy% %cnry%
- ;~ sleep 300*speed
- ;~ message=state3clickchamp
- ;~ myclick(champx+(cnrx),champy+(cnry),message)
- ;~ myclick(champx+(cnrx*ncx),champy+(cnry*ncy),message)
- ;~ sleep 300*speed
- ;~ ;lock in
- ;~ }
- }
- ;======================;
- if(state>0)
- {
- rndwait()
- messsage=clickbutton
- myclick(x,y,message)
- }
- goto again
- myclick(x,y,message) ;the custom pseoudorealistic click function
- {
- tooltip CLICKING Got %x% %y% generating randoms %message%
- sleep 200*speed2
- Random smx, 0, 40 ;generate bunch of random values to vary pixel location for mouse actions
- Random smy, 0, 10 ;good values to keep within the button
- Random morecenterx, 0, 6 ;odds of better aiming, only if non-zero values will initiate aim-boost
- Random morecentery, 0, 5
- Random smx2, 10, 30 ;how much more centered will the mouse be
- Random smy2, 2, 10
- tooltip CLICKING generated randoms %smx% %smy% %morecenterx% %morecentery% %smx2% %smy2% %message%
- sleep 50*speed2
- finalmousex := x+smx ;x, y - from image search are topleft corner, add offsets
- finalmousey := y+smy
- tooltip CLICKING generated randoms %smx% %smy% %morecenterx% %morecentery% %smx2% %smy2% finalmouse %finalmousex% %finalmousey% as from %x% and %y% %message%
- sleep 150*speed2
- tooltip CLICKING 1 2 %finalmousex% %finalmousey% %message%
- sleep 100*speed2
- if (morecenterx > 0) ;if non-zero, center it more
- {
- finalmousex +=smx2
- }
- if (morecentery > 0)
- {
- finalmousey +=smy2
- }
- Random randragx, 0,2 ;click and drag, to simulate not a precise pixel click
- Random randragy, 0,3
- MouseMove, finalmousex, finalmousey, 0
- tooltip CLICKING 1 2 3 %finalmousex% %finalmousey% %message%
- sleep 200*speed2
- MouseClickDrag Left, finalmousex, finalmousey, finalmousex+randragx, finalmousey+randragy
- tooltip CLICKING 1 2 3 4 %message%
- sleep 200*speed2
- MouseMove, 200+smx, 200+smy, 0
- tooltip CLICKED 1 2 3 4 5 %message%
- Sleep 200*speed2
- }
- return
- rndwait() ;random duration waits
- {
- Random srnd, 100, 500
- sleep %srnd%
- }
- return
- ProcessExist(Name){ ;wrapper
- Process,Exist,%Name%
- return Errorlevel
- }
- typetext(thetext) ;random delays between each key press
- {
- textarray := StrSplit(thetext)
- tooltip typetext %textarray%
- Loop % textarray.MaxIndex()
- {
- Random r1, 10, 100
- Random r2, 5, 10
- SetKeyDelay r, r2
- SendRaw % textarray[a_index]
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement