Page 2 of 2 FirstFirst 12
Results 11 to 20 of 20

Thread: Interation with Buttons in Neopets/another Links

  1. #11

    Joined
    Jan 2012
    Posts
    62
    Userbars
    1
    Thanks
    22
    Thanked
    11/2
    DL/UL
    13/2
    Mentioned
    4 times
    Time Online
    3h 50m
    Avg. Time Online
    N/A
    Quote Originally Posted by Infamous Joe View Post
    Zer0's Wrapper? Is it in VB or C#.NET? I think that's a C# wrapper... can't remember.

    Maybe post pictures of what you are trying to do?
    Yes, it's a Java class.

    I don't changed anything because I was thinking that wouldn't be necessary =\
    Last edited by loucamente; 02-03-2012 at 07:49 PM.

  2. #12
    n00ne's Avatar
    Joined
    Jan 2012
    Posts
    139
    Userbars
    1
    Thanks
    32
    Thanked
    36/25
    DL/UL
    10/0
    Mentioned
    34 times
    Time Online
    17d 2h 50m
    Avg. Time Online
    5m
    I believe he is asking how you make a command button load the tombola page then play tombola or as he so eloquently put it 'use the button'.

  3. #13
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,722
    Userbars
    166
    Thanks
    5,907
    Thanked
    33,078/6,609
    DL/UL
    23/36
    Mentioned
    3,867 times
    Time Online
    563d 5h 38m
    Avg. Time Online
    3h 13m
    Ah I'm still lost >.< Please post some pictures to help illustrate your question.
    (you need an account to see links)
    (you need an account to see links)(you need an account to see links)

    ------------------------
    [02/24/2013] Stealth CORE is made into the first standalone Neopets auto-player.
    ------------------------


  4. #14

    Joined
    Jan 2012
    Posts
    62
    Userbars
    1
    Thanks
    22
    Thanked
    11/2
    DL/UL
    13/2
    Mentioned
    4 times
    Time Online
    3h 50m
    Avg. Time Online
    N/A
    Quote Originally Posted by n00ne View Post
    I believe he is asking how you make a command button load the tombola page then play tombola or as he so eloquently put it 'use the button'.
    yes, is it!

    ---------- Post added at 04:50 PM ---------- Previous post was at 04:33 PM ----------

    Quote Originally Posted by Infamous Joe View Post
    Ah I'm still lost >.< Please post some pictures to help illustrate your question.
    Ok, my copy of Zer0's wrapper:
    Code:
    package fluxoUrl;
    
    import java.io.*;
    import java.net.*;
    import java.util.*;
    import java.util.zip.*;
    import java.awt.image.BufferedImage;
    import javax.imageio.ImageIO;
    
    public class Conexao implements Serializable {
       static final long serialVersionUID = 1L;
    
       String domain, referer;
       Map<String,String> cookies;
    
       static String rpUseragent = "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.8) Gecko/20100722 Firefox/3.6.8";
       static String rpAcceptText = "ttext/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
       static String rpAcceptPng = "image/png,image/*;q=0.8,*/*;q=0.5";
       static String rpAcceptLanguage = "en-us,en;q=0.5";
       static String rpAcceptEncoding = "gzip, deflate";
       static String rpAcceptCharset = "ISO-8859-1,utf-8;q=0.7,*;q=0.7";
       static String rpKeepAlive = "300";
       static String rpConnection = "keep-alive";
       static String rpContentType = "application/x-www-form-urlencoded";
    
       public Conexao(String domain, Map<String,String> cookies, String referer) {
          this.domain = domain;
          this.cookies = cookies;
          this.referer = referer;
       }
    
       public Conexao(String domain, Map<String,String> cookies) {
          this(domain, cookies, null);
       }
    
       public Conexao(String domain, String referer) {
          this(domain, new HashMap<String,String>(), referer);
       }
    
       public Conexao(String domain) {
          this(domain, new HashMap<String,String>(), null);
       }
    
       public String get(String url) {
          if(url.charAt(0) == '/')
             url = domain + url;
    
          try {
             HttpURLConnection conn = (HttpURLConnection)(new URL(url.replaceAll(" ", "%20")).openConnection());
             setRequestProperties(conn);
             conn.setRequestMethod("GET");
             referer = url;
             return read(conn);
          } catch(IOException e1) {
             return null;
          }
       }
    
          public String getButtonAction(String ButtonName, String value, String url) {
          try {
             HttpURLConnection conn = (HttpURLConnection)(new URL(url.replaceAll(" ", "%20")).openConnection());
             setRequestProperties(conn);
             conn.setRequestProperty(ButtonName, value);
             conn.setRequestMethod("GET");
             conn.getResponseCode();
             referer = url;
             return read(conn);
          } catch(IOException e1) {
             return null;
          }
       }
    
       public String post(String url, String[][] data) {
          if(url.charAt(0) == '/')
             url = domain + url;
    
          try {
             HttpURLConnection conn = (HttpURLConnection)(new URL(url.replaceAll(" ", "%20")).openConnection());
             setRequestProperties(conn);
             conn.setRequestMethod("POST");
             conn.setDoOutput(true);
    
             StringBuilder sb = new StringBuilder();
    
             for(int i = 0; i < data[0].length; i++)
                sb.append(URLEncoder.encode(data[0][i], "UTF-8")).append('=').append(URLEncoder.encode(data[1][i], "UTF-8")).append('&');
    
             conn.setRequestProperty("Content-Type", rpContentType);
             conn.setRequestProperty("Content-Length", Integer.toString(sb.length()-1));
    
             PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(conn.getOutputStream())));
             out.write(sb.substring(0, sb.length()-1));
             out.close();
    
             referer = url;
             return read(conn);
          } catch(IOException e1) {
             return null;
          }
       }
    
    
       public BufferedImage getImage(String url) {
          try {
             HttpURLConnection conn = (HttpURLConnection)(new URL((url.charAt(0) == '/' ? domain+url : url).replaceAll(" ", "%20")).openConnection());
             setRequestProperties(conn);
             conn.setRequestMethod("GET");
             conn.setRequestProperty("Accept", rpAcceptPng);
             return ImageIO.read(conn.getInputStream());
          } catch(IOException e1) {
             return null;
          }
       }
    
       public boolean hasCookie(String key) {
          return cookies.containsKey(key);
       }
    
       public String getCookieString() {
          StringBuilder sb = new StringBuilder();
    
          for(String s : cookies.keySet())
             sb.append(s).append('=').append(cookies.get(s)).append(';');
    
          return sb.toString();
       }
    
       private void setRequestProperties(HttpURLConnection conn) {
          conn.setInstanceFollowRedirects(false);
          conn.setRequestProperty("User-Agent", rpUseragent);
          conn.setRequestProperty("Accept", rpAcceptText);
          conn.setRequestProperty("Accept-Language", rpAcceptLanguage);
          conn.setRequestProperty("Accept-Encoding", rpAcceptEncoding);
          conn.setRequestProperty("Accept-Charset", rpAcceptCharset);
          conn.setRequestProperty("Keep-Alive", rpKeepAlive);
          conn.setRequestProperty("Connection", rpConnection);
    
          if(referer != null && referer.length() != 0)
             conn.setRequestProperty("Referer", referer);
    
          if(cookies != null && cookies.size() != 0)
             conn.setRequestProperty("Cookie", getCookieString());
       }
    
       private String read(HttpURLConnection conn) throws IOException {
          BufferedReader in = null;
    
          if(conn.getContentEncoding() == null)
             in = new BufferedReader(new InputStreamReader(conn.getInputStream()));
          else
             if(conn.getContentEncoding().equalsIgnoreCase("gzip"))
                in = new BufferedReader(new InputStreamReader(new GZIPInputStream(conn.getInputStream())));
             else if(conn.getContentEncoding().equalsIgnoreCase("deflate"))
                in = new BufferedReader(new InputStreamReader(new InflaterInputStream(conn.getInputStream(), new Inflater(true))));
    
          StringBuilder sb = new StringBuilder();
          String s;
    
          while((s = in.readLine()) != null)
             sb.append(s).append('\n');
    
          putCookies(conn.getHeaderFields().get("Set-Cookie"));
          return sb.toString();
       }
    
       private void putCookies(List<String> cookieList) {
          if(cookieList == null)
             return;
    
          int index;
    
          for(String cookie : cookieList)
             cookies.put(cookie.substring(0, index = cookie.indexOf('=')), cookie.substring(index+1, cookie.indexOf(';', index)));
       }
    
    }
    Yesterday was working at least for keep the connection, but today is useless because neither keeps the login!
    O.O
    What the hell happens? I don't changed anything important in the code of Zer0's wrapper!

    ---------- Post added at 04:53 PM ---------- Previous post was at 04:50 PM ----------

    Yes, I need of a new wrapper...

  5. #15
    n00ne's Avatar
    Joined
    Jan 2012
    Posts
    139
    Userbars
    1
    Thanks
    32
    Thanked
    36/25
    DL/UL
    10/0
    Mentioned
    34 times
    Time Online
    17d 2h 50m
    Avg. Time Online
    5m
    I'll try explain Joe. His aim is to create a tombola player, he knows how to call the page (would be something along the lines of):

    Code:
    w.GetWrapper("http://www.neopets.com/island/tombola.phtml")
    He now want's to play tombola. I would of thought it would be along the line of PostWrapper tombola2.phtml as a referrer from tombola.phtml?(Just realised it's also what soredivide suggested trying), but basically a method to press "Play Tombola". Or if you still cant understand

    Code:
    <form action='tombola2.phtml' method='post'>
    <input type='submit' value='Play Tombola!'>
    lmao, pictures to illustrate ur question.... it weren't that bad xD.
    Last edited by n00ne; 02-04-2012 at 11:02 PM.

  6. #16

    Joined
    Dec 2011
    Posts
    151
    Userbars
    2
    Thanks
    4
    Thanked
    165/45
    DL/UL
    14/9
    Mentioned
    68 times
    Time Online
    6d 17h 26m
    Avg. Time Online
    2m
    Try changing wrappers (sock has a java wrapper), seems all I needed was a referrer. Post some of your code, not the wrapper.
    Last edited by Soredavide; 02-05-2012 at 06:47 AM.

  7. #17

    Joined
    Jan 2012
    Posts
    62
    Userbars
    1
    Thanks
    22
    Thanked
    11/2
    DL/UL
    13/2
    Mentioned
    4 times
    Time Online
    3h 50m
    Avg. Time Online
    N/A
    I don't have a code for it... I just do a example, because I needed understand how the interation can be done. I posted the wrapper used for this, considering the wrapper to after make the method in java, but I think that with this wrapper doesn't has support. I will try to make my own wrapper and if not works, I will use another language programming.

  8. #18
    Josh's Avatar
    Joined
    Dec 2011
    Posts
    415
    Userbars
    2
    Thanks
    25
    Thanked
    378/143
    DL/UL
    82/6
    Mentioned
    120 times
    Time Online
    17d 9h 48m
    Avg. Time Online
    5m
    Quote Originally Posted by loucamente View Post
    I don't have a code for it... I just do a example, because I needed understand how the interation can be done. I posted the wrapper used for this, considering the wrapper to after make the method in java, but I think that with this wrapper doesn't has support. I will try to make my own wrapper and if not works, I will use another language programming.
    How do you expect to make a wrapper if you arent able to use one that is already made for you? I know the wrapper works, since its the same one Ive used for all my java programs. Don't blame the wrapper for you not knowing how to use it.

    Post some code of you attempting to use the wrapper. That is the only way we will be able to help you, unless we wrote the entire program for you.


    Just a few hints:
    Code:
    private static Connection w = new Connection( "http://www.neopets.com" );
    ^You need something like that first. And you need to actually be logged into neo, which is where you should have learned how to post data with a wrapper.


    Learn to create the program in visual basic. Theres no need to use java for this type of program. Its a lot easier to learn the basics of neo programming in a language that isnt as complex. Java is not an easy language.
    Last edited by Josh; 02-07-2012 at 09:16 AM.

  9. The Following User Says Thank You to Josh For This Useful Post:

    loucamente (02-07-2012)

  10. #19
    Saiyan Race
    j03's Avatar
    Joined
    Dec 2011
    Posts
    13,722
    Userbars
    166
    Thanks
    5,907
    Thanked
    33,078/6,609
    DL/UL
    23/36
    Mentioned
    3,867 times
    Time Online
    563d 5h 38m
    Avg. Time Online
    3h 13m
    ^Neither is VB6, but the use of a wrapper makes everything easier.
    (you need an account to see links)
    (you need an account to see links)(you need an account to see links)

    ------------------------
    [02/24/2013] Stealth CORE is made into the first standalone Neopets auto-player.
    ------------------------


  11. The Following User Says Thank You to j03 For This Useful Post:

    loucamente (02-07-2012)

  12. #20

    Joined
    Jan 2012
    Posts
    62
    Userbars
    1
    Thanks
    22
    Thanked
    11/2
    DL/UL
    13/2
    Mentioned
    4 times
    Time Online
    3h 50m
    Avg. Time Online
    N/A
    Quote Originally Posted by Josh21227 View Post
    How do you expect to make a wrapper if you arent able to use one that is already made for you? I know the wrapper works, since its the same one Ive used for all my java programs. Don't blame the wrapper for you not knowing how to use it.

    Post some code of you attempting to use the wrapper. That is the only way we will be able to help you, unless we wrote the entire program for you.


    Just a few hints:
    Code:
    private static Connection w = new Connection( "http://www.neopets.com" );
    ^You need something like that first. And you need to actually be logged into neo, which is where you should have learned how to post data with a wrapper.


    Learn to create the program in visual basic. Theres no need to use java for this type of program. Its a lot easier to learn the basics of neo programming in a language that isnt as complex. Java is not an easy language.
    thank you anyway, after I will try VB6. My java program makes log in but I'm having a lot of problems with this question of buttons...

    ---------- Post added at 05:55 PM ---------- Previous post was at 05:54 PM ----------

    Quote Originally Posted by Infamous Joe View Post
    ^Neither is VB6, but the use of a wrapper makes everything easier.
    Okay, then I will try VB6. =]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •