| Forum Main>>General Discussion>> calling all scripters |
Demented_Clown
ID: 262310
Level: 52
Posts: 3501
Score: 1007
| Thread created on Sun Feb 10, 2013 05:05:07 Last replied to on Fri Feb 15, 2013 10:21:24
|
I'm looking for a function that can pull information from one torn page and insert it into another. I've been doing the lessons on codecademy just to see if the topic is covered but neither the javascript nor jquery lessons cover the idea of scripting across pages. Googling the the topic didn't turn up anything that i thought was relevant. My ideal script works like this
// Gather item totals from items.php
// create an object/array with said totals
// display totals in a div on museum.php
|
A few scripts i have seen posted here gather users' "last action" from their profile page and that essentially what i'd like to do with items . I just dont know where to get started with the function.
Last Edited: Sun Feb 10, 2013 05:05:58
|

 |
| Super secret reinforced spam barrier 2.0 |
Skulls
ID: 1538618
Level: 44
Posts: 2090
Score: -2474
| Posted on Sun Feb 10, 2013 05:20:25
|
scripting is illegal. bye bye, off to fed with you.
|
 |
| Super secret reinforced spam barrier 2.0 |
CravenTHC
ID: 1569996
Level: 45
Posts: 1861
Score: 1685
| Posted on Sun Feb 10, 2013 05:23:03
|
I don't really think this is the best forum to be asking this question. Since the authorities on scripting are well known why not just PM one of them? XOR and Cyberdude come to mind immediately.
|

|
| Super secret reinforced spam barrier 2.0 |
Demented_Clown
ID: 262310
Level: 52
Posts: 3501
Score: 1007
| Posted on Sun Feb 10, 2013 05:30:26
|
Scripting is by no means illegal. This sort of script is simply manipulating data that is already on the page
I want to take flower totals from items.php and (re)place them on the museum.php page
|

 |
| Super secret reinforced spam barrier 2.0 |
Butters
ID: 34298
Level: 66
Posts: 4323
Score: 2010
| Posted on Sun Feb 10, 2013 08:28:31
|
The question that springs to mind at my end is why not just post a suggestion regarding having the counts for each flower type added to the flower set conversion museum page in the suggestions forum, instead of messing around trying to get a script to do it.
|
| Super secret reinforced spam barrier 2.0 |
XOR
ID: 743049
Level: 54
Posts: 5487
Score: 3039
| Posted on Sun Feb 10, 2013 10:07:25
|
Okay.. we will start off with:
Easy Way:
1) Install jQuery into your scripts. I use jQuery v1.6.2 as some later versions DO break torn's JS. Linky: jquery.com/
2) Use a $.get(url, action); as the way of loading data.
For example, user visits museum.php, and the script kicks in.
Use this for your includes:
// @include https://www.torn.com/museum.php
// @include http://www.torn.com/museum.php |
And then for your main code:
alert('This occurs first');
$.get('/items.php', function (itemsHtml) {
alert('This is the last 500 characters of the HTML for items.php');
alert(itemsHtml.substr( itemsHtml.length - 500 ));
// Do the rest of your stuff in here.
});
alert('This is a second alert box. May be 3rd or 4th depending upon the GET request time.');
|
That's pretty much it.
Because the GET (and POST) requests are asynchronous, you will have to take care to ensure that all your code runs IN the get request, when dealing with the data from that GET request.
If you want to see a script do roughly what you're trying to do...
My museum exchange script already loads the data from items page.
Linky: userscripts.org/scripts/show/132479
-=EDIT=-
For those saying scripting is illegal...
Scripts are legal!
The difference between *you* loading the items page, and a script doing it...
is the script makes it easier and more automatic... leading to no mistakes.
Now when these scripts bypass security, or even "Do stuff without being logged in (Xerxes)".. then it's illegal.
Also: Any automatic sending scripts (Without user's performing any actions) is 100% illegal.
Last Edited: Sun Feb 10, 2013 10:13:40
|
Ched, Hire me as a developer. Peek my profile!
God watches you have a poo. Serious. _ |
| Super secret reinforced spam barrier 2.0 |
Demented_Clown
ID: 262310
Level: 52
Posts: 3501
Score: 1007
| Posted on Sun Feb 10, 2013 15:32:35
|
Thank you XOR Your script does just what i wanted to do. No need to reinvent the wheel i guess. I am going to peek inside and figure it out though.
|

 |
| Super secret reinforced spam barrier 2.0 |
Brimshae
ID: 350403
Level: 50
Posts: 1102
Score: 333
| Posted on Mon Feb 11, 2013 13:51:53
|
I am interested in this. What do you plan to do with it?
|
| No sig required. |
| Super secret reinforced spam barrier 2.0 |
Tampons
ID: 1707233
Level: 20
Posts: 230
Score: 216
| Posted on Mon Feb 11, 2013 16:24:06
|
XOR: Where do you get scrips that help you play this game that not cheating?
|
 |
| Super secret reinforced spam barrier 2.0 |
XOR
ID: 743049
Level: 54
Posts: 5487
Score: 3039
| Posted on Mon Feb 11, 2013 17:25:52
|
By IAmSu [1707233]
XOR: Where do you get scrips that help you play this game that not cheating? |
I create them.
You can check my scripts lists, they are on my profile.
Or you can check out Cyber_Dude (May have spelt name wrong) for his script pack!
|
Ched, Hire me as a developer. Peek my profile!
God watches you have a poo. Serious. _ |
| Super secret reinforced spam barrier 2.0 |
python
ID: 1009878
Level: 35
Posts: 3604
Score: 1856
| Posted on Mon Feb 11, 2013 23:21:12
|
using scripts for flower sets is ilegal as it is doing something quicker than it would take non scripter
|
| Super secret reinforced spam barrier 2.0 |
XOR
ID: 743049
Level: 54
Posts: 5487
Score: 3039
| Posted on Tue Feb 12, 2013 09:31:23
|
By python [1009878]
using scripts for flower sets is ilegal as it is doing something quicker than it would take non scripter |
Incorrect.
Scripts are designed to make things quicker/easier. That's the whole point of them.
The *only* possible illegal section of the script is that it automates the reading , and usage, of RFCs.
The the script itself is a manual thing. It only exchanges the flowers, and only when the button is clicked.
Therefore, it allows the user to quickly exchange flower sets.
Not, have it automatic.
|
Ched, Hire me as a developer. Peek my profile!
God watches you have a poo. Serious. _ |
| Super secret reinforced spam barrier 2.0 |
SmoSa
ID: 1689455
Level: 22
Posts: 13
Score: 5
| Posted on Thu Feb 14, 2013 23:53:03
|
So this would count as a legal script then? (see below message thread - bottom to top)
2013-02-14
11:48:56 PM smokinsammy says: That doesn't seem right. Then what's the point of having a SED? :
2013-02-14
Bloodhoof says: Vidit XOR's page, aslong as the scripts don't do anything that when your offine, like auto traveller, the thing I have is legal, and I will keep this for the use of someone else.
2013-02-14
11:46:06 PM smokinsammy says: I didn't think that having scripts that gave you an unfair advantage was legal.
2013-02-14
11:44:37 PM Bloodhoof says: Ty for the parcel, if only I didn't have a script tht said what's in it, oh wait, I do how strange, haha
2013-02-14
10:43:29 PM Bloodhoof says: Why you attacking me in the first place....?
2013-02-14
10:38:53 PM smokinsammy says: Proper English would be "you're in trouble" as in "you are".
2013-02-14
12:31:21 PM Bloodhoof says: Wellll now your in trouble
2013-02-14
12:19:17 PM Bloodhoof says: Why u attacking me when ewe aren't at war....?
|
| Super secret reinforced spam barrier 2.0 |
-Kriller-
ID: 687993
Level: 75
Posts: 2443
Score: 1013
| Posted on Thu Feb 14, 2013 23:56:42
|
By smokinsammy [1689455]
So this would count as a legal script then? (see below message thread - bottom to top)
2013-02-14
11:48:56 PM smokinsammy says: That doesn't seem right. Then what's the point of having a SED? :
2013-02-14
Bloodhoof says: Vidit XOR's page, aslong as the scripts don't do anything that when your offine, like auto traveller, the thing I have is legal, and I will keep this for the use of someone else.
2013-02-14
11:46:06 PM smokinsammy says: I didn't think that having scripts that gave you an unfair advantage was legal.
2013-02-14
11:44:37 PM Bloodhoof says: Ty for the parcel, if only I didn't have a script tht said what's in it, oh wait, I do how strange, haha
2013-02-14
10:43:29 PM Bloodhoof says: Why you attacking me in the first place....?
2013-02-14
10:38:53 PM smokinsammy says: Proper English would be "you're in trouble" as in "you are".
2013-02-14
12:31:21 PM Bloodhoof says: Wellll now your in trouble
2013-02-14
12:19:17 PM Bloodhoof says: Why u attacking me when ewe aren't at war....? |
id say yes, as you can go to the post office and see whats inside a parcel, but if it shows an actual SED where you changed the item (if the option is still available) then im not sure
|
| Super secret reinforced spam barrier 2.0 |
SmoSa
ID: 1689455
Level: 22
Posts: 13
Score: 5
| Posted on Fri Feb 15, 2013 00:24:16
|
Yeah, it was packed up with a bunch of bags of chocolate truffles, and I set it to the same, so it showed like 8 of them. pretty lame.
|
| Super secret reinforced spam barrier 2.0 |
Makbeth
ID: 913832
Level: 52
Posts: 629
Score: 511
| Posted on Fri Feb 15, 2013 10:21:24
|
Scripting is not illegal, if it were your browser would be guilty. You are not changing any data on the website, just changing how your computer displays the data to you. It doesnt give any advantage other than ease of use.
Its fine. I think it gets shady when people try to use automated scripts to perform actions in the game. You cant to that.
|
|
|
Follow @TornRPG