Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2017-01-06 21:48:35

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

[Release] Batch/C# Hybrid

Hello! I present unto you... uhh... something useless but... neat I guess.

Its a batch file that compiles itself as a C# application, so you can make bots in notepad now.

/*>nul
cls

::Batch Code

@echo off

echo Hello! I am a batch hybrid.

set PATH=%PATH%;;C:\Windows\Microsoft.NET\Framework\v4.0.30319

CSC /t:exe /r:PlayerIOClient.dll /out:bot.exe /o+ /debug- %0

bot.exe
del bot.exe

pause

goto :eof
*/

//C# Code
using System;
using PlayerIOClient;

namespace BatchHybrid {
	class Program {
		public static Connection con;
		
		static void Main(string[] args) {
			Write("Hello World! From a C# Batch Hybrid!", true);
			Write("Email: ", false);
			string email = Input(true);
			Write("Password: ", false);
			string password = Input(true);
			Write("World Id: ", false);
			string worldid = Input(true);
			
			Client c = PlayerIO.QuickConnect.SimpleConnect( "everybody-edits-su9rn58o40itdbnw69plyw", email, password, null );
			con = c.Multiplayer.JoinRoom(worldid, null);
			
			con.OnMessage += con_OnMessage;
			con.Send("init");
			System.Console.ReadKey();
		}
		
		public static void con_OnMessage(object sender, Message e) {
			switch( e.Type ) {
				case "init":
					con.Send("init2");
					break;
				case "init2":
					con.Send("say", "Hello World!");
					break;
			}
		}
		
		static string Input(bool newLine) {
			string ret = System.Console.ReadLine();
			if(newLine) {
				System.Console.WriteLine("");
			}
			return ret;
		}
		
		static void Write(string r, bool newLine) {
			System.Console.Write(r);
			if(newLine) {
				System.Console.WriteLine("");
			}
		}
	}
}

All you need is PlayerIOClient.dll next to the batch file and it works!
So you can make bots in notepad now...

yea i guess it's cool whatever.

Offline

Wooted by: (2)

#2 2017-01-06 21:49:27

Myst
Guest

Re: [Release] Batch/C# Hybrid

ninjasupeatsninja wrote:

Hello! I present unto you... uhh... something useless but... neat I guess.

Its a batch file that compiles itself as a C# application, so you can make bots in notepad now.

/*>nul
cls

::Batch Code

@echo off

echo Hello! I am a batch hybrid.

set PATH=%PATH%;;C:\Windows\Microsoft.NET\Framework\v4.0.30319

CSC /t:exe /r:PlayerIOClient.dll /out:bot.exe /o+ /debug- %0

bot.exe
del bot.exe

pause

goto :eof
*/

//C# Code
using System;
using PlayerIOClient;

namespace BatchHybrid {
	class Program {
		public static Connection con;
		
		static void Main(string[] args) {
			Write("Hello World! From a C# Batch Hybrid!", true);
			Write("Email: ", false);
			string email = Input(true);
			Write("Password: ", false);
			string password = Input(true);
			Write("World Id: ", false);
			string worldid = Input(true);
			
			Client c = PlayerIO.QuickConnect.SimpleConnect( "everybody-edits-su9rn58o40itdbnw69plyw", email, password, null );
			con = c.Multiplayer.JoinRoom(worldid, null);
			
			con.OnMessage += con_OnMessage;
			con.Send("init");
			System.Console.ReadKey();
		}
		
		public static void con_OnMessage(object sender, Message e) {
			switch( e.Type ) {
				case "init":
					con.Send("init2");
					break;
				case "init2":
					con.Send("say", "Hello World!");
					break;
			}
		}
		
		static string Input(bool newLine) {
			string ret = System.Console.ReadLine();
			if(newLine) {
				System.Console.WriteLine("");
			}
			return ret;
		}
		
		static void Write(string r, bool newLine) {
			System.Console.Write(r);
			if(newLine) {
				System.Console.WriteLine("");
			}
		}
	}
}

All you need is PlayerIOClient.dll next to the batch file and it works!
So you can make bots in notepad now...

yea i guess it's cool whatever.

notepad or notepad++?

#3 2017-01-06 21:50:02

drunkbnu
Formerly HG
Joined: 2017-08-16
Posts: 2,306

Re: [Release] Batch/C# Hybrid

Yes, all what you need is PlayerIOClient.dll and CSC and mscorlib.dll and all the other libraries for .NET Framework to work.

Offline

Wooted by: (2)

#4 2017-01-06 21:50:54

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: [Release] Batch/C# Hybrid

gp68 wrote:

notepad or notepad++?

either one will do

HG wrote:

Yes, all what you need is PlayerIOClient.dll and CSC and mscorlib.dll and all the other libraries for .NET Framework to work.

//forums.everybodyedits.com/img/smilies/tongue //forums.everybodyedits.com/img/smilies/smile

Offline

Wooted by:

#5 2017-01-06 21:52:18, last edited by Myst (2017-01-06 21:52:48)

Myst
Guest

Re: [Release] Batch/C# Hybrid

ninjasupeatsninja wrote:
gp68 wrote:

notepad or notepad++?

either one will do

HG wrote:

Yes, all what you need is PlayerIOClient.dll and CSC and mscorlib.dll and all the other libraries for .NET Framework to work.

//forums.everybodyedits.com/img/smilies/tongue //forums.everybodyedits.com/img/smilies/smile

ok, ninjasupeatsninja, thx for the info

#6 2017-01-06 21:53:17, last edited by drunkbnu (2017-01-06 21:53:24)

drunkbnu
Formerly HG
Joined: 2017-08-16
Posts: 2,306

Re: [Release] Batch/C# Hybrid

@gp68 What about Atom?

Offline

#7 2017-01-06 21:56:28

Myst
Guest

Re: [Release] Batch/C# Hybrid

HG wrote:

@gp68 What about Atom?

idk what this is and i can't install it //forums.everybodyedits.com/img/smilies/tongue

#8 2017-01-06 23:19:37, last edited by Swarth100 (2017-01-06 23:21:01)

Swarth100
Member
Joined: 2015-07-18
Posts: 305

Re: [Release] Batch/C# Hybrid

gp68 wrote:
HG wrote:

@gp68 What about Atom?

idk what this is and i can't install it //forums.everybodyedits.com/img/smilies/tongue

Atom is a very good IDE, strongly recommended due to the massive in-built support of github plug-ins for the various languages.

EDIT: Recommended for the less-used languages (I used it for Haskell and GoLang), if you wanna go with mainstream Python, Java or C, there might be IDEs with a lot more functionalities around.

Offline

#9 2017-01-06 23:22:09

drunkbnu
Formerly HG
Joined: 2017-08-16
Posts: 2,306

Re: [Release] Batch/C# Hybrid

Swarth100 wrote:
gp68 wrote:
HG wrote:

@gp68 What about Atom?

idk what this is and i can't install it //forums.everybodyedits.com/img/smilies/tongue

Atom is a very good IDE, strongly recommended due to the massive in-built support of github plug-ins for the various languages.

EDIT: Recommended for the less-used languages (I used it for Haskell and GoLang), if you wanna go with mainstream Python, Java or C, there might be IDEs with a lot more functionalities around.

Atom is a text editor, not a solution manager.

Offline

#10 2017-01-06 23:27:42

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,852

Re: [Release] Batch/C# Hybrid

HG wrote:

Yes, all what you need is PlayerIOClient.dll and CSC and mscorlib.dll and all the other libraries for .NET Framework to work.

yeah so let's be objective and less "boo this is another" for a moment

what do we actually gain through this method over other things? i.e., is the tradeoff ninja suggests simply the VS suite for mscorlib and CSC? I mean, PIOC.DLL and the .NET framework are already required under normal sistuations

so disregarding whether or not that's actually useful, is that what we're facing?

Offline

#11 2017-01-06 23:40:58

SirJosh3917
Formerly ninjasupeatsninja
From: USA
Joined: 2015-04-05
Posts: 2,095

Re: [Release] Batch/C# Hybrid

hummerz5 wrote:
HG wrote:

Yes, all what you need is PlayerIOClient.dll and CSC and mscorlib.dll and all the other libraries for .NET Framework to work.

yeah so let's be objective and less "boo this is another" for a moment

what do we actually gain through this method over other things? i.e., is the tradeoff ninja suggests simply the VS suite for mscorlib and CSC? I mean, PIOC.DLL and the .NET framework are already required under normal sistuations

so disregarding whether or not that's actually useful, is that what we're facing?

1-
hummerz pls
pls
every 1 of my topics has a debate shh pls no

2-
im just making it so people can make a bot in a plain text editor
give or take the different directory structure of everyone's computer.

pls no judge ;-;

Offline

#12 2017-01-06 23:47:53

Swarth100
Member
Joined: 2015-07-18
Posts: 305

Re: [Release] Batch/C# Hybrid

HG wrote:
Swarth100 wrote:
gp68 wrote:
HG wrote:

@gp68 What about Atom?

idk what this is and i can't install it //forums.everybodyedits.com/img/smilies/tongue

Atom is a very good IDE, strongly recommended due to the massive in-built support of github plug-ins for the various languages.

EDIT: Recommended for the less-used languages (I used it for Haskell and GoLang), if you wanna go with mainstream Python, Java or C, there might be IDEs with a lot more functionalities around.

Atom is a text editor, not a solution manager.

Let me taste the spice through the keyboard.

Yup.

It worked.

Offline

#13 2017-01-06 23:56:37

SmittyW
Member
Joined: 2015-03-13
Posts: 2,085

Re: [Release] Batch/C# Hybrid

ninjasupeatsninja wrote:

1-
hummerz pls
pls
every 1 of my topics has a debate shh pls no

2-
im just making it so people can make a bot in a plain text editor
give or take the different directory structure of everyone's computer.

pls no judge ;-;

If you're going to keep posting topics you should be susceptible to criticism. We only improve because of people who say "hey, this isn't good enough" or "we could do better". This is a forum for discussing topics. If you only want to link your creations then get your own repo or something.

Offline

Wooted by: (2)

#14 2017-01-07 00:24:22, last edited by LukeM (2017-01-07 00:26:47)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: [Release] Batch/C# Hybrid

ninjasupeatsninja wrote:

so you can make bots in notepad now.

You always could make a bot in notepad, just you'd need to have a way to compile it. I used this sort of idea a while ago (although implemented differently) for my minigame bot (that I didnt have enough time to properly complete, so it never really took off)

I guess this would be useful though, for those who dont want / can't get VS for some reason, and dont know how to use the command prompt themselves. Also I'd compile to the same directory as the file, and put the delete at the start instead, so this acts as a simple way to compile, that you can run when you make a change to the code, unless there was a reason for putting it at the end. (As you seem to be worried about efficiency, I'm not sure compiling a bot every time you run it is a good idea)

Offline

#15 2017-01-07 00:39:57, last edited by hummerz5 (2017-01-07 01:42:56)

hummerz5
Member
From: wait I'm not a secret mod huh
Joined: 2015-08-10
Posts: 5,852

Re: [Release] Batch/C# Hybrid

so csc is already the thing that does the thing, this batch just automates the CSC.exe call?

can someone answer this?

hummerz5 wrote:
HG wrote:

Yes, all what you need is PlayerIOClient.dll and CSC and mscorlib.dll and all the other libraries for .NET Framework to work.

yeah so let's be objective and less "boo this is another" for a moment

what do we actually gain through this method over other things? i.e., is the tradeoff ninja suggests simply the VS suite for mscorlib and CSC? I mean, PIOC.DLL and the .NET framework are already required under normal sistuations

so disregarding whether or not that's actually useful, is that what we're facing?

if anything, ninja, you should be considering this question instead of assuming I just want to write you off.

Doesn't CSC come with VS, not just the regular OS? Therefore, you should mention the need to bundle CSC or whatever the answer to my question is so that people know what's up if they do choose to use your setup.

edit: OP apparently decided to lock the thread. peculiar move, I'm genuinely interested in the discussion

Offline

hummerz51483745997642210

Board footer

Powered by FluxBB

[ Started around 1711666934.7613 - Generated in 0.106 seconds, 12 queries executed - Memory usage: 1.7 MiB (Peak: 1.92 MiB) ]