Quantcast

Jump to content


Photo

Making Programs

programs

  • Please log in to reply
4 replies to this topic

#1 lozhazie

lozhazie
  • 1 posts

Posted 12 December 2015 - 04:17 PM

Hi All I have used Neocodex for a number of years but never really conversed on the forums.

 

The reason I am here today is, I want to make a program that interacts with a webpage in much the same way some of the Neocodex programs do with the Neopets site. 

 

What I want my program to do is:

  1. Load a Specific Web page
  2. Search for specific text within that page.
  3. If text exists then click a certain part of the page and then repeat from step one. If not, then repeat from step one.

and that's it. I have no idea where to start. If anyone can point me in the right direction of what the program should be written in and maybe a beginners guide I would be greatly appreciative. 

 

Thanks all in advance



#2 KyloRen

KyloRen
  • Snoke says I'm special.



  • 5,124 posts


Users Awards

Posted 12 December 2015 - 04:52 PM

We've got a guide on python.

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

 

And one on wxpython. 

http://www.neocodex....de-to-wxpython/

 

I'm not sure how helpful they'll be to you, but it's a start. I don't know much about programming or I'd help more, sorry. 



#3 Adam

Adam
  • Coffee God


  • 4,359 posts


Users Awards

Posted 12 December 2015 - 05:24 PM

I know this isn't what you wanted exactly, but it'll point you in the right direction. Credits to cx323 I think.

public string NeoLogin(string user, string pass, ref bool loggedIn)
        {
            string strHTML = null;
            Request("GET", "http://neopets.com/loginpage.phtml", "http://google.com");
            Pause(1);
            Request("POST", "http://www.neopets.com/hi.phtml?destination=%2Fpetcentral.phtml&username=" + user, "http://neopets.com/loginpage.phtml");
            Pause(1);
            strHTML = Request("POST", "http://www.neopets.com/login.phtml?username=" + user + "&password=" + pass + "&destination=%2Fpetcentral.phtml", "http://neopets.com/hi.phtml");
            if (strHTML.Contains("Set-Cookie: neologin="))
            {
                loggedIn = true;
                return "Logged In";
            }
            else if (strHTML.Contains("too many times"))
            {
                loggedIn = false;
                return "To Many Login Attempts";
            }
            else if (strHTML.Contains("badpassword"))
            {
                loggedIn = false;
                return "Wrong Password";
            }
            else if (strHTML.Contains("frozen"))
            {
                loggedIn = false;
                return "Account Frozen";
            }
            else if (strHTML.Contains("just a technical problem"))
            {
                loggedIn = false;
                return "Neopets is down for maintenance.";
            }
            else
            {
                loggedIn = false;
                return strHTML;
            }
        }

Oh yeah, and then there's this.

if (strHTML.Contains("HTMLPHRASE"))
                {
                    log.Items.Add(CurrentTime() + ": Logged in as " + user.Text);
                    stop.Enabled = true;
                }

If the phrase "htmlphrase" is found in the HTML page that is loaded, then whatever is between the brackets will happen. 



#4 koutei

koutei

  • 80 posts

Posted 12 December 2015 - 09:48 PM

@Adam, is that in C#? Are most Codex programs written in languages like C# / Python, or is it just a general "if it works and is deemed safe, we don't care what it's written in"?



#5 Adam

Adam
  • Coffee God


  • 4,359 posts


Users Awards

Posted 12 December 2015 - 09:50 PM

What I posted was written in C#. I don't know how to write anything in python. The 'offical' coding language of codex is indeed Python. That's what the Program Manager is made from.





Also tagged with one or more of these keywords: programs

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users