Quantcast

Jump to content


Photo

C++ or C# for NP programs


  • Please log in to reply
27 replies to this topic

#1 Neon

Neon
  • 96 posts

Posted 03 June 2013 - 07:07 AM

Hey there guys, I've actually never created a program for neopets, but I'm looking to create my first one!

 

Most of my programming knowledge comes from my university level classes where we programmed almost primarily in C++. We dabbled a very tiny bit in C# and obviously its pretty close to C++ so I would feel comfortable in that as well.

 

Most of my knowledge came from examination of data structures and implementing them from scratch but I think I could extend that knowledge pretty easily.

 

Are there a lot of headaches using either of these languages? What kind of libraries do you need to start making NP programs? Any other tips for using these languages?

 

 



#2 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 03 June 2013 - 07:30 AM

What kind of libraries do you need to start making NP programs? Any other tips for using these languages?


You shouldn't need much, most Neopets programs are basically just made up of sending/receiving http data and then basic programming elements like string manipulation and looping etc. Most people prefer to use a wrapper to take the complexity out of the http programming, you might want to speak to Valorous about his approach to that if you're wanting to use C# otherwise you'll probably find an old one hanging around in this section somewhere.

#3 Melchoire

Melchoire
  • 5284 posts


Users Awards

Posted 03 June 2013 - 07:59 AM

What kind of libraries do you need to start making NP programs?

 

Some sort HTTP library.

 

If you decide to use C++, there's the libcurl library. Overall, making a NP program in C++ will probably be fairly difficult for a beginner.

 

C# makes it tremendously easier though with lots of different HTTP related classes. The easiest (and most abstracted) is WebClient which itself is a wrapper around the HttpWebRequest and HttpWebResponse classes.



#4 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 03 June 2013 - 08:01 AM

We've been friends for ages and you know you're better off using Python. That said almost anything worth coding is done already unless you count really well put together suites :(



#5 Yung

Yung
  • Codexian

  • 3361 posts


Users Awards

Posted 03 June 2013 - 08:18 AM

We've been friends for ages and you know you're better off using Python. That said almost anything worth coding is done already unless you count really well put together suites :(


We still need a solid User Shop Autobuyer...

#6 DarkCitric

DarkCitric
  • 5 posts

Posted 03 June 2013 - 08:42 AM

I've got quite a bit of experience in C++ if you get something started.



#7 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 03 June 2013 - 09:13 AM

We still need a solid User Shop Autobuyer...

 

That's true. Not exactly a super profitable experience, but can be useful.



#8 Neon

Neon
  • 96 posts

Posted 03 June 2013 - 09:27 AM

We've been friends for ages and you know you're better off using Python. That said almost anything worth coding is done already unless you count really well put together suites :(

 

I wasn't doing it to be the first kid on the block... Just doing it to get some experience with different kinds of programming in C languages.

 

Was thinking of a good auto-trainer with the features that I personally would want that others might not.

 

We still need a solid User Shop Autobuyer...

 

Would also be something that I'm interested in since you would probably use some sort of a skeleton version of this kind of code for an auto-trainer to purchase the codestones.



#9 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 03 June 2013 - 09:29 AM

I wasn't doing it to be the first kid on the block... Just doing it to get some experience with different kinds of programming in C languages.

 

Was thinking of a good auto-trainer with the features that I personally would want that others might not.

 

 

Would also be something that I'm interested in since you would probably use some sort of a skeleton version of this kind of code for an auto-trainer to purchase the codestones.

 

The user shop portion wouldn't take too long to code. You could do it in a day or so I'd say. If you want coding experience help me code my automatic meshing tool in Glyph :(



#10 Neon

Neon
  • 96 posts

Posted 03 June 2013 - 09:32 AM

The user shop portion wouldn't take too long to code. You could do it in a day or so I'd say. If you want coding experience help me code my automatic meshing tool in Glyph :(

 

Nooooooooooooooo thanks.

 

I'll probably try to find some source code for some neo programs in C# just to get a feel for the different HTTP portions.

 

So if anyone has some source code on some programs (even if they are outdated) that'd be great!



#11 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 03 June 2013 - 09:34 AM

Nooooooooooooooo thanks.

 

I'll probably try to find some source code for some neo programs in C# just to get a feel for the different HTTP portions.

 

So if anyone has some source code on some programs (even if they are outdated) that'd be great!

 

I think I have some give me some time to check. You're probably better off by looking at some tutorials about navigating the internet with C# and learning how send POST/GET. It's hard to do anything on my PC when it's running FLUENT sims.

 

 

Edit: Better yet go beg Valorous to let you see some of his source code. I think his entire suite is coded in C#.


Edited by Shrouded, 03 June 2013 - 09:37 AM.


#12 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 03 June 2013 - 09:41 AM

Nooooooooooooooo thanks.
 
I'll probably try to find some source code for some neo programs in C# just to get a feel for the different HTTP portions.
 
So if anyone has some source code on some programs (even if they are outdated) that'd be great!


You might find some examples in our (very) old code snippets sections:

http://www.neocodex....um/forum/277-c/
http://www.neocodex....m/forum/275-cc/

#13 Neon

Neon
  • 96 posts

Posted 03 June 2013 - 09:45 AM

I think I have some give me some time to check. You're probably better off by looking at some tutorials about navigating the internet with C# and learning how send POST/GET. It's hard to do anything on my PC when it's running FLUENT sims.

 

 

Edit: Better yet go beg Valorous to let you see some of his source code. I think his entire suite is coded in C#.

 

Begging has already commenced.

 

Thanks for those Waser!



#14 Melchoire

Melchoire
  • 5284 posts


Users Awards

Posted 03 June 2013 - 09:56 AM

Nooooooooooooooo thanks.

 

I'll probably try to find some source code for some neo programs in C# just to get a feel for the different HTTP portions.

 

So if anyone has some source code on some programs (even if they are outdated) that'd be great!

 

Just to give you a feel for how easy it can be in C#:

            WebClient wc = new WebClient();
            wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            string dpage = wc.UploadString("http://www.neopets.com/login.phtml", "destination=%252Findex.phtml&username=abc&password=def");



#15 Neon

Neon
  • 96 posts

Posted 03 June 2013 - 10:02 AM

Just to give you a feel for how easy it can be in C#:

            WebClient wc = new WebClient();
            wc.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            string dpage = wc.UploadString("http://www.neopets.com/login.phtml", "destination=%252Findex.phtml&username=abc&password=def");

 

What in the whattttt, this looks so much easier than what I was expecting in my head. This gives me some hope!

 

I'll play around tonight and post any problems I'm running into in here, you guys have been awesome helpful so far, now it's just time to get my hands dirty!

 

Any recommendations for a good IDE to use? My school doesn't allow the use of IDE's since they consider them a crutch but I'd like to leave Notepad Plus for awhile...



#16 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 03 June 2013 - 10:13 AM

Any recommendations for a good IDE to use? My school doesn't allow the use of IDE's since they consider them a crutch but I'd like to leave Notepad Plus for awhile...


If you're using C# then Visual Studio would probably be the logical place to start.

#17 Neon

Neon
  • 96 posts

Posted 03 June 2013 - 10:14 AM

If you're using C# then Visual Studio would probably be the logical place to start.

 

Yeah I downloaded Visual Studio Express was just curious if anyone used anything different!



#18 Melchoire

Melchoire
  • 5284 posts


Users Awards

Posted 03 June 2013 - 10:20 AM

Yeah I downloaded Visual Studio Express was just curious if anyone used anything different!

 

You're free to type out your .csproj(xml) files by hand and invoke msbuild.exe from the command line to build it. :p

 

I disagree with people who say the IDE is a crutch. I've found it to be the complete opposite when writing for C#.



#19 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 03 June 2013 - 10:30 AM

I disagree with people who say the IDE is a crutch. I've found it to be the complete opposite when writing for C#.


I think it's a bit snobbish when people claim that using an IDE is a crutch, it's just a way to increase productivity really.

#20 Neon

Neon
  • 96 posts

Posted 03 June 2013 - 10:40 AM

I think it's a bit snobbish when people claim that using an IDE is a crutch, it's just a way to increase productivity really.

 

I think in my case it was an effort to understand what your code is doing at a base level instead of having the IDE just tell you what is wrong with it. Taught me to be thorough and added a lot of frustration as well...



#21 Hydrogen

Hydrogen
  • Neocodex Co-Founder

  • 22213 posts


Users Awards

Posted 03 June 2013 - 03:58 PM

I think it's a bit snobbish when people claim that using an IDE is a crutch, it's just a way to increase productivity really.

I think when his university mentioned that, they weren't saying it's bad to use an IDE but that it's bad to use an IDE without knowing what's going on under the hood. People don't program in assembly anymore for the same reason IDEs were invented. However, to do systems programming without knowing your way around machine code would be short sighted :/

#22 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 04 June 2013 - 01:11 PM

Yeah I downloaded Visual Studio Express was just curious if anyone used anything different!

 

UVa and VT both have licenses to the professional/ultimate version. 



#23 Valorous

Valorous
  • 1003 posts


Users Awards

Posted 10 June 2013 - 05:42 PM

Everything you will need for C# development of Neopets bots.

 

I use VS2012 Utlimate from my Ultimate MSDN subscription.


Edited by Valorous, 10 June 2013 - 05:44 PM.


#24 shrouded

shrouded
  • lil'cluck

  • 1250 posts


Users Awards

Posted 10 June 2013 - 09:48 PM

It sure is nice when UVa and VT right that big check to cover all licenses for students and faculty. :D



#25 Valorous

Valorous
  • 1003 posts


Users Awards

Posted 11 June 2013 - 11:45 AM

It sure is nice when UVa and VT right that big check to cover all licenses for students and faculty. :D

It's also nice when the company you work for has nearly endless capex budget and you're told by management to use it or it's reduced the following year.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users