• 0

Need some help with a script.


Question

Hey guys, on my site DominateDominion.com I am trying to have a table that updates every day. Basically, I play a game called League of Legends and they have a map called Dominion. There is no ranked mode for dominion, but I was given some files that can get the players elo. I have a note pad where I type in the person's usernamer whos elo I want to find out, then I run a batch file, and open results.txt and it gives the players elo. The guy who gave me the files said all I need for it to update on my site automatically each day was a script where it dumps all the users from the site to a file, runs the batch file, then sends the update back to the server. So how could I do this? I'm don't know any programming or anything at all. Where should I start looking?

Link to comment
https://www.neowin.net/forum/topic/1057344-need-some-help-with-a-script/
Share on other sites

Recommended Posts

  • 0

To have a script executed once per day you need a scheduled task / cronjob.

If programming is needed, then you'll need to post a copy of the code this person has given to you, along with any relevant code from your website and hope someone here has some free time to help you integrate it.

Your site appears to be running wordpress, so thats a good start, we know you've got PHP available.

  • 0

To have a script executed once per day you need a scheduled task / cronjob.

If programming is needed, then you'll need to post a copy of the code this person has given to you, along with any relevant code from your website and hope someone here has some free time to help you integrate it.

Your site appears to be running wordpress, so thats a good start, we know you've got PHP available.

I can do it manually as well. But it's not a script he gave me. Or maybe it is. He sent me like 4 files.

  • 0

Can you post the files in a zip file on here? Or are they sensitive...

Well he told me he doesn't want me sharing them around a lot. But he knows i'm trying to get it on my site which he is fine with. Sooo... :\

BTW, i'm willing to pay someone if they want to do this for me.

  • 0

Ok, just so the whole community can help out: the OP has a Windows executable, called by a batch script with a couple of arguments, that returns the results of the query into results.txt.

If you have a Windows server for your webhosting, as theblazingangel said, you can set the batch script up on a scheduled task. From there it's easy to write a PHP file that pulls the results from the text file to display it on your site.

....but I guess the main question is, do you use a Windows server for your hosting?

  • 0

Ok, just so the whole community can help out: the OP has a Windows executable, called by a batch script with a couple of arguments, that returns the results of the query into results.txt.

If you have a Windows server for your webhosting, as theblazingangel said, you can set the batch script up on a scheduled task. From there it's easy to write a PHP file that pulls the results from the text file to display it on your site.

....but I guess the main question is, do you use a Windows server for your hosting?

Errrmmm. I don't know honestly. I use bluehost.com to host my site.

  • 0

Errrmmm. I don't know honestly. I use bluehost.com to host my site.

Create a file called whatever.php containing this:

<?php echo $_SERVER['SERVER_SOFTWARE']; ?>

Upload it to your server, go to dominatedominion.com/whatever.php, copy the output and post it here.

  • 0

You could modify the batch script (.bat file) to upload results.txt to your server upon completion, and then setup the scheduled task on your own PC... as for how, maybe someone else can help. My command line knowledge only really extends as far as Linux.

  • 0

The easiest solution i cna think of is uploading results.txt to drop box then getting your site to read the results, i believe there is two ways to do this.

1. edit th bat file to copy the results to your dropbox folder (hell maybe the exe will run from the dropbox folder i dont know check!) then schedule the file to run

2. have 2 bat files one runs the bat file the second uploads to your dropbox

Of cause your computer needs to be on at the time of the schedule

Someone here was uploading a folder with a bat file.

http://forums.dropbox.com/topic.php?id=18137

  • 0

Just saying that would be the easiest solution as of now, if it is uploaded by schedule then the text file is included its doneas for commandline:

To add new scheduled task:

  • Go to Windows Start Menu > Control Panel > System and Security > Administrative Tools > Schedule Tasks.
  • In the Task Scheduler menu go to Action > Create Basic Task.
  • Give your task a name and click Next.
  • Choose when the task should be run and click Next.
  • For task action, select Start a program and client Next.
  • Browse for WinSCP.exe executable.
  • In Add arguments add appropriate WinSCP command-line parameters to execute the scripting commands you need (typically you will use /script or /command parameters).
    The resulting arguments may look like:
    /command ?option batch abort? ?option confirm off? ?open user:[email protected]? ?put d:\examplefile.txt /home/user/? ?exit?
    Note that the command-line parameter /console was not specified, what makes WinSCP.exe not show the console window, not to disturb you while you are using your workstation.
  • You may want to use /log parameter to turn on session logging to file.
  • When done, click Next, review your options and confirm with Finish.
    source: http://winscp.net/eng/docs/guide_schedule
    O
    f cause it may be different with a host

  • 0

Alright guys, I talked to the person who gave me the files but i'm a bit confused as to what he is saying. He seems to think this should work though? (I'm thefeedski, he is jabe).

TheFeedski (4:10): Alright, so you know how you told me I just have to get someone to make a script that does whatever

I have ti saved, 1 sec

Ok you said "script where it dumps all the users from the site to a file, runs the batch file, then sends the update back to the server."

Jabe (4:11): yes

TheFeedski (4:11): Ok, so they told me that's easy enough to do if my hosting runs windows.

But they use linux.

So...

Someone said

"you can get the [uncompiled] source code of the .exe file from the guy who gave you the files (doubtful). "

Jabe (4:11): Do you have a database?

TheFeedski (4:12): if you*

Do I have a database?

Jabe (4:12): Yes

TheFeedski (4:12): Uhhh. Maybe? lol

I don't know. :p

Jabe (4:12): Or how are you planning on showing these ranks?

TheFeedski (4:12): I was just wanting them in a table

like highest to lowest.

Jabe (4:12): I assumed you'd have a database of users that people could look at a page and the table would be automatically generated

TheFeedski (4:13): I mean, I have a forum with everyones name.

I mean, they put their LoL account when registering.

Jabe (4:14): What forum software?

TheFeedski (4:14): phpbb

Jabe (4:14): You probably have a database then

TheFeedski (4:15): ah, ok.

Jabe (4:15): So script does...

"select lol_acct from users", dump list to file, execute program, update ratings in DB

Needs an extra column to store ratings first

Then someone can make a page that generates a table of all users

No need to copy files, just update DB

*update and query

He said I have to make sure I have a database first though.

  • 0

Ok, at the end of your batch script (open it in Notepad), paste this:

ftp -i -n -s:"%~f0"
open dominatedominion.com
user USERNAMEHERE
PASSWORDHERE
cd public_html
literal pasv
binary
put results.txt
disconnect
bye

Then tell us if it's successfully uploaded to http://www.dominated...com/results.txt

If so, we can help you get it from that, to displayed in a table on your website, and then tell you how to automate it. :)

  • 0

Ok, at the end of your batch script (open it in Notepad), paste this:

ftp -i -n -s:"%~f0"
open dominatedominion.com
user USERNAMEHERE
PASSWORDHERE
cd public_html
literal pasv
binary
put results.txt
disconnect
bye

Then tell us if it's successfully uploaded to http://www.dominated...com/results.txt

If so, we can help you get it from that, to displayed in a table on your website, and then tell you how to automate it. :)

Ok, just so I don't mess anything up. You want me to add that to the end of the batch file then upload JUST the batch file to my hosting? Or do I add that to the batch file and then upload just results.txt?

  • 0

You just add that to the end of the batch file then run it, if all succeeds it should hopefully upload results.txt onto the server then you just set up a schedule on your computer to automate it.

Btw im curious whats in this text file lol

Ahhh, so the username and password are for my hosting? Not my game user name and password?

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • PDF-XChange Editor 11.0.1.0 by Razvan Serea PDF-XChange Editor is a comprehensive PDF editor that allows you to create, view, edit, annotate, and digitally sign PDF documents with ease. With advanced features like OCR, document security, and PDF optimization, PDF-XChange Editor is a powerful tool for both personal and professional use. Whether you need to edit text, images, or links, or add comments, stamps, or watermarks, PDF-XChange Editor provides all the necessary tools to make your PDFs look perfect. Additionally, it supports a wide range of file formats, including PDF, XPS, and DOCX, making it easy to convert and share your documents. PDF-XChange Editor key features: Edit text and images in PDF documents Add and remove pages from PDF files Annotate and markup PDFs with comments, highlights, and stamps Use OCR to convert scanned documents into searchable text Create and fill out PDF forms Sign and certify PDF documents digitally Add and edit hyperlinks within PDFs Extract text and images from PDF files Batch process multiple PDF files at once Customize the interface to your preferences Work with multiple documents in tabs Convert PDFs to other formats such as Word, Excel, and HTML Use advanced redaction tools to permanently remove sensitive information Add customizable headers and footers to PDFs Merge multiple PDF documents into a single file Split PDF documents into multiple files Add watermarks to PDF documents Use the measurement tools to calculate distances and areas in PDFs ....and much more PDF-XChange Editor 11.0.1.0 changelog: Fixed a crash in the new Open/Save dialog box when creating a new folder in an unavailable network path. (49552) Fixed a rare/infrequent crash on some dynamic XFA forms after changing their field values. [installer] Fixed an issue where shortcuts were lost during an upgrade from the previous version. [installer] Fixed an issue preventing migration of serial keys during updates from version 10. Fixed the issues with the shell context menu after installation of version 11. Fixed the issue with filtering comments. (49478) Fixed the issue that caused "Error [IO subsystem]: Invalid access mode." when converting PDFs to MS Office formats. Fixed an issue with the context menu position on some multi-monitor systems. (48467) Fixed an issue with handling complex custom file filters, displayed by JS, in the new Open/Save Files dialog box. (49486) Fixed several issues with the new 'Select Folder' dialog box. (49505) Fixed an issue with the new custom 'Open File' dialog box when using double-click to open it. (49498) Fixed an 'infinite' loop/proliferation in the 'Open Files' and 'Manage Places' dialog boxes. (49526) Fixed an issue with handling the mouse wheel inside the document "Find" box. (49539) Fixed an incorrect behaviour in the 'Go back (Alt+Left)' button in the new Open/Save Files dialog box. (49510) Fixed an issue with the shortcut keys (Alt+Left/Right) after navigating via breadcrumb paths in the new Open/Save Files dialog box. (49554) [installer] Fixed an issue with redrawing the progress text in the EXE installers. Fixed the issue where a mouse click outside of the polyline/polygon context menu during annotation creation would cancel the annotation. (49475) We switched back to using the system Open/Save/SelectFolder dialog box by default, instead of using the new one, because some popular features such as the QuickAccess/Recent items are missing in the new version. These will be added in a future release. Replaced the 'Extension' column in the new Open/Save File dialog box with a more user-friendly 'Type' column. Also fixed some issues when handling the 'Show file extension' option. (49497) Added the ability to authenticate local network shares in the new Open/Save Files dialog box. (49557) Improved the handling of dates after 01.01.2030 in XFA files - now such dates are stored properly when set via the dropdown widget. Flags NoZoom and NoRotate are now respected for only a limited subset of annotations. Download: PDF-XChange Editor (64-bit) | Portable ~300.0 MB (Shareware) Download: PDF-XChange Editor (32-bit) | Portable ~200.0 MB Download: PDF-XChange ARM64 | 276.0 MB Download: PDF-XChange Portable @PortableApps.com | 97.0 MB View: PDF-XChange Editor Website | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • Still 3x what it should cost. So, it seems the trick is to increase price by 6x so that a reduction in price back to 4x looks like a steal. "You savvy shoppers win again!" I'm glad I'm not in a desperate spot to actually even need this overpriced crap. Hopefully, it comes back down by the time for when (or if) I ever do.
    • Although AI is great and has it's use cases they likely have massively overhyped it and it has not delivered as per their expectations. I fully expect them to start saying the same things again when it does get to a certain level of intelligence!
    • Microsoft wants to end printer driver headaches with Windows Ready Print by Usama Jawad A few days ago, Microsoft released Windows 11 Experimental build 26300.8553, bringing a ton of enhancements such as Start menu customization, search improvements, Taskbar polish, and other minor UI tweaks. Another relatively major enhancement snuck deep within the change log was related to upgrades to the Windows printing experience. Now, Microsoft has shared more details about these benefits. For starters, Microsoft has renamed its Modern Print Platform to Windows Ready Print. The company believes that this name highlights its shift in strategy, which now focuses on modernizing, securing, and streamlining the printing experience for Windows devices. Some of the upgrades present in Windows Ready Print have already been seeded to customers and partners. This includes ending support for third-party printer drivers via Windows Update and transitioning towards the Internet Printing Protocol (IPP) and the native Windows IPP printer driver. In line with these changes, new printer installations will default to Windows Ready Print on eligible devices starting from July 2026. However, Microsoft recognizes that not all environments will be able to migrate to this platform immediately, so it will allow users to choose between installing the printer via Windows Ready Print or the traditional OEM process. Users will be able to toggle this configuration through Settings > Bluetooth & Devices > Printers & Scanners > Printer preferences. This control applies only to new printer installations, and its functionality can also be modified via Group Policy as follows: Launch Group Policy Editor Navigate to Local Computer Policy -> Administrative Templates -> Printers Find and select 'Configure Windows Ready Print driver ranking' -> double click to open it Select 'Enabled' (if you wish to enable Windows Ready Print driver selection) or 'Disabled' (if you wish to explicitly disable Windows Ready Print driver selection). Select Apply Select OK Similarly, if you set up Windows protected print mode through the same setting in Windows 11, it will also default to using Windows Ready Print exclusively. Microsoft hopes that these improvements will help eradicate dependency on OEM-specific driver installation processes and simplify printer installations. We'll likely find out more about other tangible benefits in the coming months.
  • Recent Achievements

    • One Year In
      Primer1st earned a badge
      One Year In
    • Experienced
      JayZJay went up a rank
      Experienced
    • Reacting Well
      Sir_Timbit earned a badge
      Reacting Well
    • Week One Done
      rubentuben8 earned a badge
      Week One Done
    • Week One Done
      ARaclen earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      513
    2. 2
      PsYcHoKiLLa
      231
    3. 3
      +Edouard
      138
    4. 4
      ATLien_0
      87
    5. 5
      Steven P.
      81
  • Tell a friend

    Love Neowin? Tell a friend!