Quantcast

Jump to content


Photo

Programming a bot - Where to start?


  • Please log in to reply
32 replies to this topic

#1 MrSharingan

MrSharingan
  • 41 posts

Posted 22 July 2012 - 12:12 AM

Hey guys,

So I'm actually interested in programming something which could be beneficial for the community. Just a couple of things though, what's the primary program language, and would someone be able to run me through the syntax in context with neopets bots? (Examples of opening a new connection, etc. or w/e is done)
I already have previous experience with OOP and have also used Java a decent amount, I'm just not amazing at it. I know the programming constructs, so that may help out a lot!

Thanks!
-Sharingan

#2 Frosty

Frosty
  • 1521 posts

Posted 22 July 2012 - 02:54 AM

I would personally recommend Python. Such an easy language to use and understand (when you come to terms with it!) best way to learn is to just jump straight into it, read the documentation, follow some tutorials etc;
http://www.sthurlow.com/python/

As with the majority of programming questions, you'd be surprised how much you can find by just Googling how to do something in python etc :p

#3 Irradium

Irradium
  • Pyro (699) Maniac

  • 892 posts


Users Awards

Posted 22 July 2012 - 04:12 AM

Yep, you have got to use Python 3.

Of course, why use Python 3? Because:
  • Quick and easy to learn/get a hold of.
  • Massive community for you to engage with, and learn from.
  • Very few systems don't have a Python distribution you can download.
  • A massive shitload of 3rd party modules are available on the internet.
  • You can do it a lot with it, even just with it's standard library.
  • You don't need a lot of the 3rd party modules from Python 2 that haven't been ported to Python 3 yet.
  • Python 3's data types work more smoothly than 2.
  • Python 2 will soon be outdated. No point lagging behind the times. :)
Also, in response to your other question, it'll be easier to Google it. Try 'requests for humans' if you can't work with Python's standard library.

P.S. If you do decide on either Python version, I have a shitload of eBooks (DRM free) I'd be happy to lend/give you. It's always best to learn from something brought to a publishing standard as opposed to a web standard.

Edited by Irradium, 22 July 2012 - 11:45 AM.


#4 iargue

iargue
  • 10048 posts


Users Awards

Posted 22 July 2012 - 10:49 AM

I would use python 2.7, just incase you get good, you'll have a chance to work with Neocodex :p. Python 3 works, but some features you might love might not be available in python 2.7 and you would have to.

The first step is to understand syntax, and the basis for a program. Start with Hello World tutorials and move up to if and then statements. Learn how to write a thread from a start/stop button. Then write a login script for neopets, and apply them two together. Then start writing logic for the programs.

#5 RitzWin

RitzWin
  • 241 posts

Posted 22 July 2012 - 08:59 PM

Python's mechanize is where it's at :)

#6 MrSharingan

MrSharingan
  • 41 posts

Posted 22 July 2012 - 11:16 PM

Yep, you have got to use Python 3.

Of course, why use Python 3? Because:

  • Quick and easy to learn/get a hold of.
  • Massive community for you to engage with, and learn from.
  • Very few systems don't have a Python distribution you can download.
  • A massive shitload of 3rd party modules are available on the internet.
  • You can do it a lot with it, even just with it's standard library.
  • You don't need a lot of the 3rd party modules from Python 2 that haven't been ported to Python 3 yet.
  • Python 3's data types work more smoothly than 2.
  • Python 2 will soon be outdated. No point lagging behind the times. :)
Also, in response to your other question, it'll be easier to Google it. Try 'requests for humans' if you can't work with Python's standard library.

P.S. If you do decide on either Python version, I have a shitload of eBooks (DRM free) I'd be happy to lend/give you. It's always best to learn from something brought to a publishing standard as opposed to a web standard.

I would use python 2.7, just incase you get good, you'll have a chance to work with Neocodex :p. Python 3 works, but some features you might love might not be available in python 2.7 and you would have to.

The first step is to understand syntax, and the basis for a program. Start with Hello World tutorials and move up to if and then statements. Learn how to write a thread from a start/stop button. Then write a login script for neopets, and apply them two together. Then start writing logic for the programs.


Hm, well right now I'm tossing between 2.7 and 3, both having fairly viable arguments. Thinking of starting on Python 2.7 though!

#7 idontknow951

idontknow951
  • 490 posts

Posted 23 July 2012 - 12:39 AM

Yep, you have got to use Python 3.

Of course, why use Python 3? Because:

  • Quick and easy to learn/get a hold of.
  • Massive community for you to engage with, and learn from.
  • Very few systems don't have a Python distribution you can download.
  • A massive shitload of 3rd party modules are available on the internet.
  • You can do it a lot with it, even just with it's standard library.
  • You don't need a lot of the 3rd party modules from Python 2 that haven't been ported to Python 3 yet.
  • Python 3's data types work more smoothly than 2.
  • Python 2 will soon be outdated. No point lagging behind the times. :)
Also, in response to your other question, it'll be easier to Google it. Try 'requests for humans' if you can't work with Python's standard library.

P.S. If you do decide on either Python version, I have a shitload of eBooks (DRM free) I'd be happy to lend/give you. It's always best to learn from something brought to a publishing standard as opposed to a web standard.


I disagree. There are no standards. Programming isn't what everyone thinks it is. 90% of it is thinking of the logic on how to make it run efficiently and the other 10% is actually coding it itself. The only thing he would need, if he did a fair bit of OOP, is a reference table of the functions in Python.

#8 MrSharingan

MrSharingan
  • 41 posts

Posted 23 July 2012 - 03:21 AM

I don't know if anyones willing... but could someone post up the source code for a login script? I'm more of a practical learner in that sense. Would be appreciated heaps, thanks!

#9 Senrath

Senrath
  • 305 posts

Posted 23 July 2012 - 04:59 AM

I disagree. There are no standards. Programming isn't what everyone thinks it is. 90% of it is thinking of the logic on how to make it run efficiently and the other 10% is actually coding it itself. The only thing he would need, if he did a fair bit of OOP, is a reference table of the functions in Python.

I'm confused by what you're trying to say here. If you're saying that programming standards don't exist, then you're definitely wrong. And if you're saying something else, I'm not sure what it is.

#10 MEGAKICK

MEGAKICK
  • 75 posts


Users Awards

Posted 23 July 2012 - 06:22 AM

I too am interested in programming (hopefully working alongside NeoCodex one day :p), and will be following this thread closely :)

#11 Frosty

Frosty
  • 1521 posts

Posted 23 July 2012 - 06:38 AM

I don't know if anyones willing... but could someone post up the source code for a login script? I'm more of a practical learner in that sense. Would be appreciated heaps, thanks!


Login to Neopets normally while capturing HTTP Headers and see what is being sent. All you have to do is then replicate what is sent, in python. Just google "navigate websites python" or something, if you can't figure it out after that maybe you need to read some more documentation :p.

#12 idontknow951

idontknow951
  • 490 posts

Posted 24 July 2012 - 01:26 AM

I'm confused by what you're trying to say here. If you're saying that programming standards don't exist, then you're definitely wrong. And if you're saying something else, I'm not sure what it is.


Really, and what standard is there? If you mean style, yeah, there are different styles of programming, but there is no such thing as a standard.

#13 Irradium

Irradium
  • Pyro (699) Maniac

  • 892 posts


Users Awards

Posted 24 July 2012 - 03:37 AM

Really, and what standard is there? If you mean style, yeah, there are different styles of programming, but there is no such thing as a standard.


I meant different standards of publishing you two. :|

Self published = no standards that must be adhered to.
Traditionally published (or going to an actual publisher) = they essentially pay you to distribute and gain money from the book, so for them to make any money back on it, the book must be of a decent quality. If it isn't, it won't get accepted for that route of publishing, simple as.

Therefore, if you buy something from a respected, well-known/established publisher, chances are the quality of the book you buy will be higher. Just in case anyone else was on the same page as myself.

However, on this new point that has been brought up, there are programming standards, as such. True, there are different styles, and one may be seen as better/worse than the others, but then that brings in standards. It all really depends on the way you look at it, I guess. Personally, it doesn't really matter to me. I just want my code to look nice and use as little memory as possible. However that works out is good enough for me. :)

Edited by Irradium, 24 July 2012 - 03:38 AM.


#14 Senrath

Senrath
  • 305 posts

Posted 24 July 2012 - 04:15 AM

Really, and what standard is there? If you mean style, yeah, there are different styles of programming, but there is no such thing as a standard.

Different styles of programming are usually referred to as programming standards.

Not to mention pretty much each company has their own programming standards that must be followed if you work for them. There's no universal standard, but that's not the same as "no standard".

#15 Cript

Cript
  • 1940 posts


Users Awards

Posted 24 July 2012 - 04:23 AM

Login to Neopets normally while capturing HTTP Headers and see what is being sent. All you have to do is then replicate what is sent, in python. Just google "navigate websites python" or something, if you can't figure it out after that maybe you need to read some more documentation :p.


So happy someone brought this up! Part of the reason I love most programs here is that they understand user behavior, HTTP standards, and how to impersonate users. That means not just going straight to a shop but clicking the market place link first, etc. Humanizing requests has a huge impact on how safe the programs are.

Before writing code though, understanding HTTP & TCP is vital. Understand every cookie, header, etc the site expects to see in a legitimate user request.

#16 idontknow951

idontknow951
  • 490 posts

Posted 24 July 2012 - 10:11 PM

Different styles of programming are usually referred to as programming standards.

Not to mention pretty much each company has their own programming standards that must be followed if you work for them. There's no universal standard, but that's not the same as "no standard".


No, they're not. Standards would imply a level of efficiency that is a baseline to match or beat. I have never once had anyone call a programming style a standard. Furthermore, nobody really cares how you write your code as long as its readable and documented.

I guarantee you, if you walked into my office and said programming standard, everyone would look at you and go wtf.

#17 Senrath

Senrath
  • 305 posts

Posted 24 July 2012 - 10:15 PM

No, they're not. Standards would imply a level of efficiency that is a baseline to match or beat. I have never once had anyone call a programming style a standard. Furthermore, nobody really cares how you write your code as long as its readable and documented.

I guarantee you, if you walked into my office and said programming standard, everyone would look at you and go wtf.

And I guarantee you that there are plenty of companies that force their employees to code in a certain way, to a certain standard, so that all of the code looks the same.

And a quick Google search reveals lots of references to "coding standards".

Edited by Senrath, 24 July 2012 - 10:16 PM.


#18 idontknow951

idontknow951
  • 490 posts

Posted 24 July 2012 - 11:34 PM

And I guarantee you that there are plenty of companies that force their employees to code in a certain way, to a certain standard, so that all of the code looks the same.

And a quick Google search reveals lots of references to "coding standards".


:rolleyes: What does that prove? You could just as easily google "programming style" or "coding style".

#19 Senrath

Senrath
  • 305 posts

Posted 25 July 2012 - 03:58 AM

http://www.gnu.org/prep/standards/
http://en.wikipedia....#External_links

Oh, hey, look. Tons of companies that have coding standards.

#20 Cript

Cript
  • 1940 posts


Users Awards

Posted 25 July 2012 - 04:13 AM

Anyone who doesn't think there are coding standards need only ask a company how they code against SQL injections, XSS, etc.

#21 HappyAccident

HappyAccident
  • 408 posts


Users Awards

Posted 25 July 2012 - 09:05 AM

Well if you want to learn Python here is a good place to start ;)

http://www.neocodex....uide-to-python/

Pyro made it and it's very simple and easy to understand. :)

#22 MrSharingan

MrSharingan
  • 41 posts

Posted 26 July 2012 - 02:34 AM

Well if you want to learn Python here is a good place to start ;)

http://www.neocodex....uide-to-python/

Pyro made it and it's very simple and easy to understand. :)


Yes, I've already checked the tutorial out, very handy! :)

But a question to everyone, should I have a grasp on HTML, PHP, and Javascript before I attempt python?

#23 Waser Lave

Waser Lave

  • 25516 posts


Users Awards

Posted 26 July 2012 - 02:36 AM

Yes, I've already checked the tutorial out, very handy! :)

But a question to everyone, should I have a grasp on HTML, PHP, and Javascript before I attempt python?


It never hurts to have some experience but it's not really a necessity since Python is very different to those other languages you mention.

#24 HappyAccident

HappyAccident
  • 408 posts


Users Awards

Posted 26 July 2012 - 03:52 AM

HTML is really not difficult at all to learn and is very useful to know. I would suggest learning that first before you start to learn any sort of coding.

That's just my opinion.

#25 MEGAKICK

MEGAKICK
  • 75 posts


Users Awards

Posted 26 July 2012 - 02:40 PM

Don't forget that neopets has their own HTML guide! it's where I first learned HTML :p


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users