Jump to content

Help with Slither.io Controller Support?

Beeeyeee

Hey guys I've been playing a ton of Slither.io, its like Agar.io where you use the mouse cursor to move your snake around. The PRoblem is I want to play with a controller. the Thumbstick would control a ton better.

 

I was digging around on the web and I found this: https://strbeanjoe.wordpress.com/2016/04/20/slither-io-ps4-controller-support/

This adds support for the PS4 controller. could one of you make it work with the Xbox One controller? where left stick is movement and A is boost?

Link to comment
Share on other sites

Link to post
Share on other sites

On 4/22/2016 at 6:03 PM, Beeeyeee said:

Hey guys I've been playing a ton of Slither.io, its like Agar.io where you use the mouse cursor to move your snake around. The PRoblem is I want to play with a controller. the Thumbstick would control a ton better.

 

I was digging around on the web and I found this: https://strbeanjoe.wordpress.com/2016/04/20/slither-io-ps4-controller-support/

This adds support for the PS4 controller. could one of you make it work with the Xbox One controller? where left stick is movement and A is boost?

The program Gopher is a very simple way to do this. Can't speak for xbox one controller, but if it worked right away for a 360 controller I can't see why it wouldn't. You can download it here: https://github.com/Tylemagne/Gopher360/releases/tag/v0.985. Was automatically setup with 'A' as the LMB, so it should do what you want out of the box.

Link to comment
Share on other sites

Link to post
Share on other sites

10 hours ago, zorander42 said:

The program Gopher is a very simple way to do this. Can't speak for xbox one controller, but if it worked right away for a 360 controller I can't see why it wouldn't. You can download it here: https://github.com/Tylemagne/Gopher360/releases/tag/v0.985. Was automatically setup with 'A' as the LMB, so it should do what you want out of the box.

thanks man! it does work with the Xbox One Controller seemlessly and it works pretty well! the issue is, since I have multiple monitors, as soon as as the mouse leaves the single monitor it glitches out. It will work for now but I want to find a solution that can only move the mouse in some sort of radious form the center you know? thank you for that suggestion though!

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...
On 4/27/2016 at 11:09 AM, Beeeyeee said:

thanks man! it does work with the Xbox One Controller seemlessly and it works pretty well! the issue is, since I have multiple monitors, as soon as as the mouse leaves the single monitor it glitches out. It will work for now but I want to find a solution that can only move the mouse in some sort of radious form the center you know? thank you for that suggestion though!

Hmm, odd... don't remember having much issue with my second monitor active. But yeah, I had the same thought as you. If you could somehow setup a circle with a limited range for it to get the input from it would be leaps and bounds better. Think the biggest issue with this solution is that the farther the mouse gets from your head, the harder it becomes to control. So, as you said, a predefined 'circle' could make this method almost as good as a mouse IMHO.

 

Edit: Also, let me know if you have any other ideas for alternate methods of control. I've been messing around with as many as I can think of, so I'm running out of ideas. Made a reddit post here that details most of them.

Edited by zorander42
Link to comment
Share on other sites

Link to post
Share on other sites

52 minutes ago, zorander42 said:

Hmm, odd... don't remember having much issue with my second monitor active. But yeah, I had the same thought as you. If you could somehow setup a circle with a limited range for it to get the input from it would be leaps and bounds better. Think the biggest issue with this solution is that the farther the mouse gets from your head, the harder it becomes to control. So, as you said, a predefined 'circle' could make this method almost as good as a mouse IMHO.

 

Edit: Also, let me know if you have any other ideas for alternate methods of control. I've been messing around with as many as I can think of, so I'm running out of ideas. Made a reddit post here that details most of them.

I tried using a joystick and I couldn't configure it to work with any method i could find.. I wish I had a PS4 controller to try that script out. if someone could figure a way to make that work well with xbox controllers.. I'll keep this thread updated.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Beeeyeee said:

I tried using a joystick and I couldn't configure it to work with any method i could find.. I wish I had a PS4 controller to try that script out. if someone could figure a way to make that work well with xbox controllers.. I'll keep this thread updated.

Hmm... JoyToKey may be your solution to getting a joystick working. On another note, I found a program on github that does exactly what we described. That is, takes over the mouse and controls it with a circular range. But... it was made for agario. If you happen to have much experience with C# it could be a quick couple of changes to map a button for boost though.

Link to comment
Share on other sites

Link to post
Share on other sites

Just wrote a script with AHK. Let me know what you think!

 

Controls:
  • Ctrl + Alt + S to toggle on and off.
  • Hold A to boost.
  • Bumpers zoom in and out.
 
Also make sure you open it up (use a text editor) and change xWin and yWin to your monitor resolution!

slitherIO.ahk

Link to comment
Share on other sites

Link to post
Share on other sites

On 5/14/2016 at 4:44 PM, importsjc said:

Just wrote a script with AHK. Let me know what you think!

 

Controls:
  • Ctrl + Alt + S to toggle on and off.
  • Hold A to boost.
  • Bumpers zoom in and out.
 
Also make sure you open it up (use a text editor) and change xWin and yWin to your monitor resolution!

slitherIO.ahk

I don't have much experience coding, how do I get this script to run?

 

Update: After some googling, I found that I just needed to download the AHK program and run it!

Link to comment
Share on other sites

Link to post
Share on other sites

  • 1 year later...

I started messing with this for an xbox360 controller and added a few features. 

 

ctrl+alt+s starts it. 

 

Start is the enter key to get back into the game once you die, select will hide your cursor.

 

change the x,y to your screen resolution.

 

 

;Written by Stephen Cerbone (importsjc)

xWin := 1920	
yWin := 1080

xMid := xWin/2
yMid := yWin/2

isOn = false

deadband := 20

min := 50-deadband
max := 50+deadband

xMouse := 0
yMouse := 0

#Persistent
SetTimer, ReturnMouse, 10
return

;Toggle hold on and off
^!s::
	isOn := !isOn
	return

Joy5::
	;zoom out
	if(isOn == true){
		Click WheelDown
	}
	return

Joy8::
	;enter
	if(isOn == true){
		send {enter}
	}
	return
	
Joy6::
	;zoom in
	if(isOn == true){
		Click WheelUp
	}
	return
	
ReturnMouse:
	if(isOn == true){
		if(GetKeyState("Joy1","P")){
			Click d
		}else{
			Click u
		}
		
		GetKeyState, joyx, 1JoyX
		GetKeyState, joyy, 1JoyY
		if(joyx > max or joyx < min or joyy > max or joyy < min){
			xMouse := 2*(50-joyx)*(-1)
			yMouse := 2*(50-joyy)*(-1)
		}
		MouseMove, (xMid+(xMouse)), (yMid+(yMouse))
	}
		;ToolTip, X: %xMouse%`nY: %yMouse%
		;if(isOn == true){
		;	MouseMove, xMid, yMid
		;}
	return


Joy7::

Loop 9
{
   x := !x
   SystemCursor(x)
}

SystemCursor(OnOff=1)   ; INIT = "I","Init"; OFF = 0,"Off"; TOGGLE = -1,"T","Toggle"; ON = others
{
   static AndMask, XorMask, $, h_cursor
      ,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13  ; system cursors
        , b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13  ; blank cursors
        , h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13  ; handles of default cursors
   if (OnOff = "Init" or OnOff = "I" or $ = "")       ; init when requested or at first call
   {
      $ = h                                           ; active default cursors
      VarSetCapacity( h_cursor,4444, 1 )
      VarSetCapacity( AndMask, 32*4, 0xFF )
      VarSetCapacity( XorMask, 32*4, 0 )
      system_cursors = 32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650
      StringSplit c, system_cursors, `,
      Loop %c0%
      {
         h_cursor   := DllCall( "LoadCursor", "uint",0, "uint",c%A_Index% )
         h%A_Index% := DllCall( "CopyImage",  "uint",h_cursor, "uint",2, "int",0, "int",0, "uint",0 )
         b%A_Index% := DllCall("CreateCursor","uint",0, "int",0, "int",0
                             , "int",32, "int",32, "uint",&AndMask, "uint",&XorMask )
      }
   }
   if (OnOff = 0 or OnOff = "Off" or $ = "h" and (OnOff < 0 or OnOff = "Toggle" or OnOff = "T"))
      $ = b       ; use blank cursors
   else
      $ = h       ; use the saved cursors

   Loop %c0%
   {
      h_cursor := DllCall( "CopyImage", "uint",%$%%A_Index%, "uint",2, "int",0, "int",0, "uint",0 )
      DllCall( "SetSystemCursor", "uint",h_cursor, "uint",c%A_Index% )
   }
}

return









 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×