Results 1 to 10 of 10

Thread: Posting to a page?

  1. #1
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default Posting to a page?

    How can I get simba to go to a page and pick up on something? and return if that item is correct?
    Any idea?
    Thanks Mat



    ^^

  2. #2
    Join Date
    Oct 2006
    Location
    Netherlands
    Posts
    3,285
    Mentioned
    105 Post(s)
    Quoted
    494 Post(s)

    Default

    Could you explain what you mean with
    pick up on something
    ?
    Working on: Tithe Farmer

  3. #3
    Join Date
    Feb 2007
    Location
    Florida
    Posts
    460
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Are you talking about a .txt file hosted on a server? if so then this should help:

    Simba Code:
    program new;

    Function GetInfo: String;
    Begin
      InitializeHTTPClientWrap(True); //initialize the HTTP client
      Result := GetHTTPPage(0, 'URL here'); //get the info from the web page
      Writeln(result); //write the result for debug purposes
      FreeHTTPClient(0); //Free the HTTP client
    End;

    begin
      if GetInfo = 'command here' then
      Begin
        ProcHere;
      End;
    end.

    I haven't tested this. But it should work.
    Last edited by Geo; 03-15-2012 at 06:55 PM.
    Varrock gTanner
    Previously known as England155.

  4. #4
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Geo View Post
    Are you talking about a .txt file hosted on a server? if so then this should help:

    Simba Code:
    program new;

    Function GetInfo: String;
    Begin
      InitializeHTTPClientWrap(True); //initialize the HTTP client
      Result := GetHTTPPage(0, 'URL here'); //get the info from the web page
      Writeln(result); //write the result for debug purposes
      FreeHTTPClient(0); //Free the HTTP client
    End;

    begin
      if GetInfo = 'command here' then
      Begin
        ProcHere;
      End;
    end.

    I haven't tested this. But it should work.
    Not sure if you want to use InitializeHTTPClientWrap .

    @OP:
    Simba Code:
    var
      Client : integer;
      Page : string;
    begin
      Client := InitializeHTTPClient(False);
      AddPostVariable(Client, 'Name', 'Value');
      AddPostVariable(Client, 'Name', 'Value');
      Page := PostHTTPPageEx(Client, 'http://example.com/post.php');
      FreeHTTPClient(Client);
    end.
    Don't know what you mean by pick up on something, but if you meant get the page the it responds with, the HTML is in the page variable .
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  5. #5
    Join Date
    Nov 2011
    Posts
    1,589
    Mentioned
    9 Post(s)
    Quoted
    17 Post(s)

    Default

    Like I want to make a page that gets there IP on load and checks if its in a database and will echo text on the page say 'yes' if its true or 'No' if its not in database.



    ^^

  6. #6
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Mat View Post
    Like I want to make a page that gets there IP on load and checks if its in a database and will echo text on the page say 'yes' if its true or 'No' if its not in database.
    Have you already written the code to do so? No need to use post variables to do that, just load the page and use PHP or something to get their IP and look it up in the database and return true/false.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  7. #7
    Join Date
    Jan 2007
    Posts
    8,876
    Mentioned
    123 Post(s)
    Quoted
    327 Post(s)

    Default

    GetPage also works to "visit" pages

  8. #8
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    I actually have all of this already written. I can share with you if you'd like.
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


  9. #9
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Kyle Undefined View Post
    I actually have all of this already written. I can share with you if you'd like.
    php Code:
    mysql_connect('host', 'user', 'pass');
    mysql_select_db('database');
    $q = mysql_query('SELECT * FROM table WHERE ip="' . mysql_real_escape_string($_SERVER['REMOTE_ADDR']) . '" LIMIT 0,1');
    echo (mysql_num_rows($q) == 1) ? 'true' : 'false';
    Last edited by Sex; 03-15-2012 at 07:19 PM. Reason: = -> ==
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  10. #10
    Join Date
    Oct 2008
    Location
    C:\Simba\Includes\
    Posts
    7,566
    Mentioned
    19 Post(s)
    Quoted
    180 Post(s)

    Default

    Mine already has the addition and deletion of IP's built and everything too Just as simple as yours
    Away for awhile, life is keeping me busy. | Want to get my attention in a thread? @Kyle Undefined; me.
    { MSI Phoenix || SRL Stats Sigs || Paste || Scripts || Quotes || Graphics }

    When posting a bug, please post debug! Help us, help you!

    I would love to change the world, but they won't give me the source code. || To be the best, you've got to beat the rest. || Logic never changes, just the syntax.
    If you PM me with a stupid question or one listed in FAQ, or about a script that is not mine, I will NOT respond.


    SRL is a Library of routines made by the SRL community written for the Program Simba. We produce Scripts for the game Runescape.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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