Skip to content

Commit

Permalink
whatever i changed
Browse files Browse the repository at this point in the history
  • Loading branch information
jcrutchy committed Jun 20, 2016
1 parent 53c2d3e commit 063ffc4
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
10 changes: 10 additions & 0 deletions scripts/mud/mud.php
Expand Up @@ -968,6 +968,8 @@ function find_path(&$path,$start,$finish)

function move_ai(&$player,&$players,$hostname)
{
global $dir_x;
global $dir_y;
global $map_data;
$start=array();
$start["x"]=$player["x_coord"];
Expand Down Expand Up @@ -1010,6 +1012,14 @@ function move_ai(&$player,&$players,$hostname)
privmsg("minimum path not found for ".$hostname);
return;
}
$dir=$paths[$min_path][1]["dir"];
$x=$player["x_coord"]+$dir_x[$dir];
$y=$player["y_coord"]+$dir_y[$dir];
$c=mud_map_coord($map_data["cols"],$x,$y);
$map=gzuncompress($player["map"]);
$map[$c]=$map_data["coords"][$c];
$kills=$player["kills"];
mud_update_player($hostname,$x,$y,$player["deaths"],$kills,gzcompress($map));
$player["path"]=$paths[$min_path];
}

Expand Down
17 changes: 15 additions & 2 deletions scripts/submit.php
Expand Up @@ -14,7 +14,7 @@

require_once("lib.php");

$trailing=$argv[1];
$trailing=trim($argv[1]);
$dest=$argv[2];
$nick=$argv[3];
$alias=$argv[4];
Expand All @@ -25,6 +25,15 @@
return;
}

$debug_mode=False;
$parts=explode(" ",$trailing);
if ($parts[0]=="debug")
{
$debug_mode=True;
array_shift($parts);
$trailing=implode(" ",$parts);
}

$url=$trailing;
$response=wget_proper($url);
$source_html=strip_headers($response);
Expand Down Expand Up @@ -197,6 +206,10 @@
} */

$host="soylentnews.org";
if ($debug_mode==True)
{
$host="dev.soylentnews.org";
}
$port=443;
$uri="/submit.pl";
$response=wget($host,$uri,$port,ICEWEASEL_UA);
Expand Down Expand Up @@ -234,7 +247,7 @@

var_dump($html); # TODO: extract success/error message and output to IRC

if (strpos($html,"Perhaps you would like to enter an email address or a URL next time. Thanks for the submission.")!==False)
if (strpos($html,"Thanks for the submission.")!==False)
{
privmsg("submission successful - https://$host/submit.pl?op=list");
}
Expand Down

0 comments on commit 063ffc4

Please sign in to comment.