IRC Silver quote bot scripted in MSL. reddit / irc ---------------------------------------------------------------------- McGoodotnet · 2023-11-04 00:10 Good day fellow nerds. I was hoping someone could script, or forward me the contact details of someone that can script, a snippet to fetch a live silver price both buy and sell for the price of an ounce of silver from my local shop in Canadian dollars of course :P . [https://www.bordergold.com/product/1-oz-silver- round/?currency=CAD](https://www.bordergold.com/product/1-oz-silver- round/?currency=CAD) ​ I imagine some json fetch kinda thing or whatever. I never write the code I usually just steal it / touch it up. Something like this: !buy Current buy rate is: $36.87 CAD !sell Current sell rate is: $31.06 CAD !rates Buy: $36.87 CAD Sell: $31.06 CAD ​ Thanks! ​ ---------------------------------------------------------------------- mindlesstux · 2023-11-04 00:26 What language? Sounds like a fun little project to me. ---------------------------------------------------------------------- McGoodotnet · 2023-11-04 00:28 MSL Mirc scripting language [https://en.wikipedia.org/wiki/MIRC\_scripting\_language](https://en.w ikipedia.org/wiki/MIRC_scripting_language) ​ all my bots are run on this since I am not 1337 lol ---------------------------------------------------------------------- mindlesstux · 2023-11-04 00:30 Ah well I'm out as I have not used mIRC on years. If it was Python or NodeJS I would give it a go ---------------------------------------------------------------------- McGoodotnet · 2023-11-04 00:33 I am assuming that requires some type of eggdrop type thing? ​ Thanks for reaching out regardless. ---------------------------------------------------------------------- [deleted] · 2023-11-04 04:16 [deleted] ---------------------------------------------------------------------- netzack21 · 2023-11-04 04:18 I'm not great at this, and this is not exactly what you wanted, but might be a good jumping off point. It looks for all of your triggers, but only returns the price on MarketWatch. It's a website that is easier for me to read. ​ on 1:text:\*:#:{ if ( $1 == !buy ) || ( $1 == !sell ) || ( $1 == !rates ) { set %silver.nick $nick set %silver.chan $chan set %silver.action $remove($1,!) if ( $sock(silver).status != $null ) { sockclose silver } msg %silver.chan ==== Checking the price of silver on MarketWatch.com, just a sec ==== sockopen -e silver www.marketwatch.com 443 } } on 1:sockopen:silver:{ sockwrite -n silver GET /investing/future/si00/download-data HTTP/1.1 sockwrite -n silver HOST: www.marketwatch.com sockwrite -n silver } on 1:sockread:silver:{ if ( $sockerr > 0 ) { return } :nextread sockread %silver.data if ( $sockbr == 0 ) { return } if ( %silver.data == $null) { set %silver.data - } silver.ReadData %silver.data if ( $sock(silver).status != $null ) { goto nextread } } alias silver.ReadData { if ( $1-2 == ) msg %silver.chan ==== Hey there %silver.nick ... Price of Silver: %silver.price ==== sockclose silver } } ---------------------------------------------------------------------- ScratchinCommander · 2023-11-04 20:43 You can do this with a bot running eggdrop, and your addon would probably be coded using TCL. Or, you could try doing it with MSL and leave the mIRC client running. I'd probably go the eggdrop route, lots of examples of bot scripts out there ---------------------------------------------------------------------- McGoodotnet · 2023-11-04 21:53 Super cool and much appreciated! The spot price and what I can actually buy / sell for locally are different however. ​ This is indeed a great starting point thank you kindly for your efforts on this! ​ Output: !buy ==== Checking the price of silver on MarketWatch.com, just a sec ==== ==== Hey there mcgoo ... Price of Silver: $23.335 ==== !sell ==== Checking the price of silver on MarketWatch.com, just a sec ==== ==== Hey there mcgoo ... Price of Silver: $23.335 ==== !rates ==== Checking the price of silver on MarketWatch.com, just a sec ==== ==== Hey there mcgoo ... Price of Silver: $23.335 ==== ---------------------------------------------------------------------- McGoodotnet · 2023-11-04 22:10 Honestly mirc is one of the few reasons I still run windows at all in my house. My xdcc fetch script + various other bots run off snippets in msl. ​ The script kiddie life aint for everyone lol ​ As for the eggdrop approach I found it harder to patch together personally. ---------------------------------------------------------------------- Suvorov_Yuri · 2023-11-26 01:48 mIRC scripting language is great for running bots, but I prefer Python or NodeJS for this kind of project. If anyone's got a solution in those languages, I'd be interested in giving it a go.