Stories
Slash Boxes
Comments

SoylentNews is people

Log In

Log In

Create Account  |  Retrieve Password


pastebin

Posted by crutchy on Sunday January 25 2015, @12:37PM (#972)
0 Comments
Code

had a go at making a simple pastebin. nothing fancy (no context highlighting, line numbers, etc)

http://paste.my.to/

similarish workings to the url shortener

url shortener

Posted by crutchy on Sunday January 25 2015, @03:08AM (#970)
2 Comments
Code

had a go at making a url shortener. very basic but seems to work

http://o.my.to/

you can also use it from soylent irc with the command "~shorten %url%" (must be identified with nickserv)

Friends, fans, foes, and freaks.

Posted by Runaway1956 on Saturday January 03 2015, @12:17PM (#927)
1 Comment
/dev/random

The slashcode seems to make it's own mind up who my friends etc should be. I've not added ANYONE to any of those groups. Odd . . .

IRCiv development

Posted by crutchy on Monday December 22 2014, @10:49AM (#901)
2 Comments
Code

Got IRCiv back to a working state after reworking authentication to make use of new features now built into exec. Also makes use of included alias definition, init and startup directives.

New features include map image cropping (no more huge black areas), a crop_map flag, use of notice instead of pm for private status messages, queuing of messages triggered by actions of other players, use of bot IRC message handling pause/unpause for robustness against command flooding (mainly to prevent corruption of memory shared by scripts running in parallel), a game-list command, and ability to load and save all game data to files.

Join the #civ channel in soylent IRC. Must be identified with NickServ to play. Type "~civ init" to initialize your player.
Note that IRCiv is not fully playable yet and is very much a work in progress in early stages of development.

Sample test gameplay:

<civ_test_player> ~civ u
<crutchy> ~civ d
<exec> #civ crutchy => player "civ_test_player" moved a unit within your field of vision
<exec> #civ crutchy => successfully moved settler down from (66,39) to (66,40)
<exec> #civ crutchy => you moved a unit within the field of vision of player "civ_test_player"
<exec> #civ crutchy => http://irciv.us.to/?pid=3
<exec> #civ crutchy => 1/2, warrior, +100, (76,26)
<crutchy> ~civ ?
<exec> QUICK START GUIDE
<exec> unit movement: (left|l),(right|r),(up|u),(down|d)
<exec> settler actions: (build|b)
<exec> player functions: (help|?),status,init,flag/unflag,set/unset
<exec> flags: public_status,grid,coords,city_names,crop_map
<exec> http://sylnt.us/irciv
<crutchy> ~civ unflag public_status
<exec> flag "public_status" unset for player "crutchy"
<crutchy> ~civ d
-exec- #civ crutchy => successfully moved warrior down from (76,26) to (76,27)
-exec- #civ crutchy => http://irciv.us.to/?pid=3
-exec- #civ crutchy => 0/2, settler, +100, (66,40)
<crutchy> ~civ d
-exec- #civ crutchy => successfully moved settler down from (66,40) to (66,41)
-exec- #civ crutchy => you moved a unit within the field of vision of player "civ_test_player"
-exec- #civ crutchy => http://irciv.us.to/?pid=3
-exec- #civ crutchy => 1/2, warrior, +100, (76,27)

Example map:
http://irciv.us.to/?pid=2

--
http://sylnt.us/irciv
https://github.com/crutchy-/exec-irc-bot/tree/master/scripts/irciv

The Best Defense is a Good Offense

Posted by The Mighty Buzzard on Saturday December 13 2014, @03:25PM (#881)
14 Comments
/dev/random

A couple weeks ago I was having a conversation about smoking with someone and they posited this argument in favor of smoking being illegal near entrances and exits after I'd pointed out that the danger from second-hand smoke in an open-air environment was so minuscule as to not exist: The smell offends me.

That went up one side of me and down the other and today I say to everyone using being offended as an argument for anything what I said to him: I do not care.

No, that is not me being an asshole. That is me refusing to allow you to mold the world to suit you at my expense. You have no natural, societal, legal, or God given right to not be offended in this life. And neither should you.

We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness

Those, right there, are your chief three rights. It's quite important to note that you do not have a right to happiness but only to its pursuit. Also, the the end of each is precisely located where you would start infringing on the same for anyone else. Taken together with all the other rights enumerated in the Constitution, there is a further right that is very much implicit but I believe should have been explicit: The right to be an asshole. Beyond Life and Liberty, I would go as far as to say it is our most fundamental right.

You're probably thinking I am an asshole about now. Why would I say something like being an asshole is one of our most fundamental rights? It's simple, really; because anyone at any time can call anyone else an asshole for any old arbitrary reason. If this has any bearing on the rights of the person being accused of being an asshole, then they do not really have those rights and never did in the first place. All their rights are subject to sanction or removal by cultural fiat. No due process whatsoever. Only if you have the right to offend anyone, at any time, without fear of oppression are any of your other rights secure.

Large portions of our political landscape have always been made up of unscrupulous bastards who incessantly try to convince you that offending someone is bad or wrong. See this for what it is: an attempt to get you to place chains of your own making upon yourself. They know they cannot force you to behave according to their approval or disapproval, so they attempt to shame you into doing so by being offended. There is no difference today between the puritanical right and the Social Justice Warrior on the left in this; the tactic itself is as identical as it is reprehensible.

So, convince me of your position by logical or moral argument all you like. Tell me I should do or think something because it offends you though? You can jam that right up your shitter and blow some fucking bubbles with it, you fascist asshole.

wiki sections

Posted by crutchy on Sunday December 07 2014, @07:32AM (#860)
0 Comments
Code

if you're in IRC and you wanna bring up a wiki section for discussion, type:

[[title|section]]

to output the wiki page section

eg:

[[IRC|Chat bot (Python)]]

outputs:


<exec> ELIZA module that uses Futurama personalities (to match the bot's current nick) Modify bot logging to match existing formats (mIRC preferably)
<exec> http://wiki.soylentnews.org/wiki/IRC#Chat_bot_.28Python.29

bitbucket

Posted by crutchy on Saturday November 29 2014, @11:51AM (#835)
0 Comments
Code

one of the things i'm working lately is a bitbucket feed for soylent irc (similar to the #github feed)

it currently polls the events api url for one repo (uselessd) every 5 mins and spits out a message to #github if new code is pushed

i'm still trying to figure out how to relate changesets to commits listed in push events so that i can list affected files similar to the github feed. neither the atlassian api help nor google have been very helpful.

--
https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/bitbucket_feed.php
http://sylnt.us/exec

14.12 Update

Posted by The Mighty Buzzard on Wednesday November 26 2014, @08:23PM (#830)
6 Comments
Soylent

The long and short of it is, there won't be one. We're pushing it until January due to me and PJ being occupied too much with holiday and Life stuff.

What you can look forward to:

  • Moderation Rework

Not a final version and we haven't touched meta-moderation yet but this will cut down on the echo chamber effect, mod bombing, and lay some groundwork for combating spam as well.

  • Input vs Output Wackiness

Currently if you put html entities in and hit preview they get transformed into literal characters. There's also wackiness if you try to put double quotes in a submission title. I hate this, you hate this, and it needed to stop so most of the code for it is already done and being tested on dev.

  • RSS/Atom Feeds Moving to SSL

There is really no reason to have http links in the rss feed rather than https links, so they're changing. I'm also doing my best to get them to encode only the necessary characters and display properly but it seems like no two readers display the same.

  • A Couple New Themes

Occasionally I get bored and do up a theme instead of actually working. This time around we have the VT100 and the OMG PWNIES themes. These are actually pretty easy to do. Feel free to mod and submit your own. All it takes is a custom stylesheet if you're okay with reusing existing favicons/logos.

  • Support for Additional Tags

We're adding standard support for sub/sup/abbr/strike tags. We're also adding support for the custom tags sarc/sarcasm and two forms of a "user" tag.

  • Additional Minor Bug Fixes

Bunch of minor bugs, some of which you would have never seen because they were on admin pages.

I think that's all but I'm not sure what the last one that went into our point release after the 14.12 update was.

exec live scripts

Posted by crutchy on Friday November 14 2014, @11:43AM (#803)
0 Comments
Code

the "~x" alias allows a bot operator to create and manage scripts from within IRC (dubbed "live scripts")

scripts created using this alias are stored in a bucket by the bot instead of a file

the handler uses php's eval to run live scripts

to prevent anyone from executing arbitrary commands on the bot host, a whois command is issued to verify that the NickServ account of the user of the ~x alias is the bot operator (by settling the userlist parameter of the alias definition line to "@")

the general form of the command is:

~x %action% [%param%] [%code%]

in a nutshell the possible actions and params are:
"global on|off" (enables or disables all live scripts)
"kill" (a shorcut for disabling all live scripts)
"enable %script-name%" (enables an individual live script)
"disable %script-name%" (disables an individual live script)
"delete-script %script-name%" (deletes a live script from memory)
"open %script-name%" (opens a live script for editing in the active channel)
"close" (closes the currently open live script in the active channel)
"code" (outputs a line-numbered code listing of the currently open live script in the active channel)
"list" (outputs a listing of available live scripts, and highlights enabled scripts)
"replace [L]%line-number% %old-code%|%new-code%" (replaces a line of code in the currently open live script)
"delete-line [L]%line-number%" (deletes a line of code in the currently open live script)
"insert [L]%line-number% %code%" (inserts a line of code in the currently open live script)
"add %code%" (adds a line of code to the currently open live script)

import and export (from/to file) actions are also proposed but not yet implemented.

live scripts have access to common lib functions used by other scripts, and also have direct access to $nick, $dest (channel), $trailing. the privmsg lib function doesn't work for live scripts as the live script handler is triggered internally by the bot using a registered privmsg event handler, so to privmsg the channel that the sender ($nick) is in you simply call pm($dest,"message) instead.

when a new live script is created, it must be enabled before it will run, but once enabled any changes will come into affect immediately.

whilst the code is currently limited to php, it could potentially be adapted to execute code in other languages using their command-line interpreters. it also doesn't have to be limited to code. it could potentially be used to collaborate on lines of non-executing text (such as for collaborative editing of SN submissions). with some tweaks it could be possible to collaborate on code as well, with other users being able to add/edit/delete lines but requiring the operator to re-enable the script for changes to come into effect.

ps: exec also now supports init: in-script directives, similar to startup: and exec: directives, which will increase self-containment of scripts further.

--
https://github.com/crutchy-/exec-irc-bot/blob/master/scripts/scripting.php
http://sylnt.us/exec
http://sylnt.us/execsrc

exec irc bot: script startup commands

Posted by crutchy on Tuesday November 11 2014, @01:39PM (#797)
0 Comments
Code

can now specify commands to run at startup inside scripts in a similar fashion to alias definitions

startup commands are read from one or more directives in the main exec file:

startup ./scripts

this uses the same (now more generalized) code as alias definitions; recursively searching files in the specified path for "startup:" directives (similar to "exec:" directives). like exec directives, startup directives must occur at the start of a line, so should be put in multi-line comment (below exec directive usually).

startup directives are stored until the bot identifies with NickServ, at which point the "<startup>" reserved alias is triggered followed by commands from startup directives run.

startup commands are like what you would type in IRC channels, but in this case they are intercepted by the bot and don't get transmitted to the IRC server. you can have any number of startup directive lines in a file.

example (php exec script):

/*
exec:~privmsg-internal|5|0|0|1||INTERNAL||0|php scripts/privmsg.php %%trailing%% %%nick%% %%dest%%
startup:~privmsg-internal register-events
*/

startup directives are good for triggering event registration handlers in the script, and pretty much makes a script self-contained (for now anyway).

--
http://sylnt.us/exec
http://sylnt.us/execsrc
commit for this feature: https://github.com/crutchy-/exec-irc-bot/commit/a3bb41c0d6eced1b6ec6e6573370f3db7129ccaa