Raised This Month: $32 Target: $400
 8% 

A simple plugin to download txt from website


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
SanKen
Senior Member
Join Date: Oct 2012
Location: /var/logs
Old 10-19-2014 , 10:20   A simple plugin to download txt from website
Reply With Quote #1

I need a simple plugin that gets the content of the website (http://example.com/file.txt) and saves it to a file. example addons/sourcemod/configs/file.cfg

Unfortunately, the same can not handle it.
__________________
SanKen is offline
friagram
Veteran Member
Join Date: Sep 2012
Location: Silicon Valley
Old 10-19-2014 , 13:32   Re: A simple plugin to download txt from website
Reply With Quote #2

You will need to use an extension like socket, or curl to grab the page.
__________________
Profile - Plugins
Add me on steam if you are seeking sp/map/model commissions.
friagram is offline
SanKen
Senior Member
Join Date: Oct 2012
Location: /var/logs
Old 10-19-2014 , 14:05   Re: A simple plugin to download txt from website
Reply With Quote #3

So it will curl, but unfortunately I do not have enough knowledge to write it yourself.
__________________
SanKen is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 10-19-2014 , 16:14   Re: A simple plugin to download txt from website
Reply With Quote #4

Use this as an example.
https://forums.alliedmods.net/showthread.php?p=2057761
Leonardo is offline
SanKen
Senior Member
Join Date: Oct 2012
Location: /var/logs
Old 10-19-2014 , 16:34   Re: A simple plugin to download txt from website
Reply With Quote #5

The more I mean a simple plugin that when I start maps download content and save this txt.
__________________
SanKen is offline
SanKen
Senior Member
Join Date: Oct 2012
Location: /var/logs
Old 10-21-2014 , 06:59   Re: A simple plugin to download txt from website
Reply With Quote #6

He would have found someone a little time? I'll be very grateful.
__________________
SanKen is offline
Leonardo
Veteran Member
Join Date: Feb 2010
Location: 90's
Old 10-27-2014 , 10:27   Re: A simple plugin to download txt from website
Reply With Quote #7

Quote:
Originally Posted by Root_ View Post
Why not SteamWorks?
__________________

Last edited by Leonardo; 10-27-2014 at 10:27.
Leonardo is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 10-27-2014 , 10:42   Re: A simple plugin to download txt from website
Reply With Quote #8

Try this one. It requires either Socket, cURL, SteamTools or SteamWorks to download file and compile plugin!
There are 3 ConVars:
  • sm_dfile_refresh "0" = Determines when download and refresh file:0 - Once, 1 - At every map change.
  • sm_dfile_url "http://dayofdefeat.ru/dods/plugin/banlist.txt" = Define URL here of file to download (should be direct link to given file!)
  • sm_dfile_dir "data/file.txt" = Define SM directory and its name of file to save.
It also has file_download server command (if you need to manually redownload file).
It generates config (plugin.file_downloader.cfg), so setup URLs and dirs for plugin there. Copied Wrote from scratch, so dont judge me.
Attached Files
File Type: smx file_downloader.smx (10.2 KB, 205 views)
File Type: sp Get Plugin or Get Source (file_downloader.sp - 618 views - 11.9 KB)
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot

Last edited by Root_; 10-27-2014 at 12:36.
Root_ is offline
SanKen
Senior Member
Join Date: Oct 2012
Location: /var/logs
Old 10-31-2014 , 12:28   Re: A simple plugin to download txt from website
Reply With Quote #9

Thank you very much. I asked for something simple. But it also works. There is a chance that the plugin throw other functions? now usage Socket. And unfortunately, I do not know who is good and does not burden the server.
__________________
SanKen is offline
SanKen
Senior Member
Join Date: Oct 2012
Location: /var/logs
Old 05-31-2015 , 07:31   Re: A simple plugin to download txt from website
Reply With Quote #10

Can anyone help? After the update CSGO plugin stopped working. After updating SourceMod 1.6.x to 1.7.2 in the error logs I see.

Quote:
L 05/31/2015 - 1321: [SM] Native "ReadPackString" reported: DataPack operation is out of bounds.
L 05/31/2015 - 1321: [SM] Displaying call stack trace for plugin "file_downloader.smx":
L 05/31/2015 - 1321: [SM] [0] Line 184, file_downloader.sp::OnSocketConnected()
__________________
SanKen is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode