• What are you working on? V4 (HTML ISN'T PROGRAMMING)
    2,003 replies, posted
[QUOTE=Jawalt;18104474]I made what I believe to be a completely unbeatable robot (like 90% of the time) it's code is as small as possible with as little logic as possible, and it's only goal is to collect ammo then kill. It's called ScavangerAdvanced.[/QUOTE] We'll see when I add scoring tomorrow :smug:
[QUOTE=Robert64;18104651]We'll see when I add scoring tomorrow :smug:[/QUOTE] Can we get the enemy health ? this_health ok...
[QUOTE=Mechanical43;18104743]Can we get the enemy health ? this_health ok...[/QUOTE] This is the own bot, should be enemy_health.
Haven't been doing much lately but here is what I've done in the last few days. Updated Playlist Editor for my music player [media]http://img62.imageshack.us/img62/1538/kajammercomparelistedit.png[/media] Instead of using a text editor to edit a playlist, it uses a List widget. So instead of using plain text, it uses widgets that represent the tracks that you can move up and down or whatever. Also updated options dialog [media]http://img97.imageshack.us/img97/930/kajammercompareoptionsd.png[/media] Just a cleaner layout manager. And the password field displays asterisks now. I had to cross out my password in the old manager. :v:
Ubuntu?
[QUOTE=Wipmuck;18107145]Ubuntu?[/QUOTE] Gentoo. :v: I'm using KDE 4.3.2 with a black color scheme.
[QUOTE=PvtCupcakes;18107139]Haven't been doing much lately but here is what I've done in the last few days. Updated Playlist Editor for my music player Instead of using a text editor to edit a playlist, it uses a List widget. So instead of using plain text, it uses widgets that represent the tracks that you can move up and down or whatever. Also updated options dialog Just a cleaner layout manager. And the password field displays asterisks now. I had to cross out my password in the old manager. :v:[/QUOTE] i must say, looks pretty nice
[QUOTE=PvtCupcakes;18107139]Haven't been doing much lately but here is what I've done in the last few days. Updated Playlist Editor for my music player [media]http://img62.imageshack.us/img62/1538/kajammercomparelistedit.png[/media] Instead of using a text editor to edit a playlist, it uses a List widget. So instead of using plain text, it uses widgets that represent the tracks that you can move up and down or whatever. [/QUOTE] Looks very nice and it's good to see you are still working on kajammer, but to be honest, that GUI playlist editor provides very little over editing a text file. I think you should have a window similar to winamps media library, so you can browse the playlist by artist, album etc and drag and drop them into the playlist etc. Right now it looks like the playlist editor is completely disjoint from the media library (does kajammer have a media library style thing yet?).
[QUOTE=r4nk_;18107457]Looks very nice and it's good to see you are still working on kajammer, but to be honest, that GUI playlist editor provides very little over editing a text file. I think you should have a window similar to winamps media library, so you can browse the playlist by artist, album etc and drag and drop them into the playlist etc. Right now it looks like the playlist editor is completely disjoint from the media library (does kajammer have a media library style thing yet?).[/QUOTE] I've kind of avoided that in the past because it would require knowledge in SQL, but I've been thinking more about doing it lately. Maybe when I get around to learning sqlite I'll do it. The main window's interface would need a lot of work to do that right, but the backend stuff should be modular enough that it won't take that much work to put it in I hope.
[url]http://www.robertandsherman.co.uk/botbattle/[/url] Fixed updating bots! Now onto scoring. Edit: Finished scoring! Watch ranked games at: [url]http://www.robertandsherman.co.uk/botbattle/watch.php[/url] If a bot has an error in it's code and you get a red output in the console, just refresh the page.
[QUOTE=Robert64;18109386][url]http://www.robertandsherman.co.uk/botbattle/[/url] Fixed updating bots! Now onto scoring. Edit: Finished scoring! Watch ranked games at: [url]http://www.robertandsherman.co.uk/botbattle/watch.php[/url] If a bot has an error in it's code and you get a red output in the console, just refresh the page.[/QUOTE] Add a pit of flame :D My game now has gravity and the person will walk up stairs :D Just need to do jumping and then I can work on the world more.
[QUOTE=iPope;18109650]Add a pit of flame :D[/QUOTE] Actually I like that idea - so you have to make sure your bot avoid it otherwise it loses health rapidly or even instantly dies. I might also make land mines that your bot can drop.
Please add enemy_health and enemy_ammo. It's vital for my bot.
[QUOTE=Robber;18109881]Please add enemy_health and enemy_ammo. It's vital for my bot.[/QUOTE] Ok, adding now. I'll edit this post to say when it's done. Edit: Done, you may need to clear your cache though. Edit2: Another value you can use in an if is "rand", which generates a number from 0 to 100.
[media]http://www.youtube.com/watch?v=FipeknjKKxM[/media] Behold! Not updated really, I was partying last night.
Been working on my profile site for the web development part of my computer science course at portsmouth. At home for the weekend and turned my Eee PC into a local webserver with xampp which was cool, sister connected to my site via local IP. It's trivial but it's cool :buddy: It uses PHP to make it so i don't have to change lots of pages if i want to say change the tab bar. I'm a noob at php but here's ma shit. In the index.php file... [code] <body> <?php include("rc/textFromFile.php"); ?> [/code] In textFromFile.php... [code] <?php function EchoTextFromFile($filename) { $text = file_get_contents($filename, FILE_TEXT, NULL); if($text) echo($text); else echo("<br />ERROR: Text from " . $filename . " could not be read."); } ?> [/code] And it's usage in the index.php file... [code] <?php EchoTextFromFile("rc/tabbar.txt"); ?> [/code] And tabbar.txt... [code] <div id="tabbar">This | Is | The | Tab | Bar</div> [/code] It's really cool how easy this stuff works because it's sort of quite new to me. I've known the concepts for ages but haven't actually put it into practice much before now. I'll upload the site in a bit... [url]http://jallenbah.co.uk[/url] <- There
[QUOTE=Jallen;18110113]Been working on my profile site for the web development part of my computer science course at portsmouth. At home for the weekend and turned my Eee PC into a local webserver with xampp which was cool, sister connected to my site via local IP. It's trivial but it's cool :buddy: It uses PHP to make it so i don't have to change lots of pages if i want to say change the tab bar. I'm a noob at php but here's ma shit. In the index.php file... In textFromFile.php... And it's usage in the index.php file... And tabbar.txt... It's really cool how easy this stuff works because it's sort of quite new to me. I've known the concepts for ages but haven't actually put it into practice much before now. I'll upload the site in a bit...[/QUOTE] Whatever you do with that system, no matter how easy and dynamic this solution would be, do not use stuff like [code] $page = $_GET["p"]; EchoTextFromFile($page . ".txt"); [/code] Because that's so vulnerable to abuse
Added a leaderboard: [url]http://www.robertandsherman.co.uk/botbattle/leaderboard.php[/url] Damnit I'm 4th on my own fucking game
[QUOTE=ThePuska;18110150]Whatever you do with that system, no matter how easy and dynamic this solution would be, do not use stuff like [code] $page = $_GET["p"]; EchoTextFromFile($page . ".txt"); [/code] Because that's so vulnerable to abuse[/QUOTE] I'm too much of a noob to realise what that does but ok.
[QUOTE=Robert64;18110187]Added a leaderboard: [url]http://www.robertandsherman.co.uk/botbattle/leaderboard.php[/url] Damnit I'm 4th on my own fucking game[/QUOTE] Fuck yes, two bots up there. Feels good man. [editline]01:46PM[/editline] Hey, I should have first place...since when is 12 wins superior to 13 wins?
[QUOTE=Jallen;18110196]I'm too much of a noob to realise what that does but ok.[/QUOTE] It will allow users to browse though your files.
[QUOTE=Jallen;18110196]I'm too much of a noob to realise what that does but ok.[/QUOTE] It directly gets data from the "address" of the page. If some other page is linking to page.php like this: [code]<a href="page.php?asd=file">link</a>[/code] And page.php has the code: [code]echo $_GET["asd"];[/code] page.php will echo "file" when an user clicks the link
Right ok, I was thinking of just having the single php file index.php and having all content stored in text files in the rc folder. I've seen php urls where its all like /something.php?someKindOfDataHere So would I be able to somehow pass the filename as some data in the url like index.php?gamedevpage And have it use EchoTextFromFile to echo all of the text from the file gamedevpage.txt into the main content block of the page? Or is that exactly what you are telling me not to do? If it's not then how would I do that? Oh wait so i could do something like [code]EchoTextFromFile($_GET["content"]);[/code] and in the url it would be all like [code]index.php?content=gamedevpage.txt[/code] Or is that a terrible and insecure thing to do?
[QUOTE=Jallen;18110327]Right ok, I was thinking of just having the single php file index.php and having all content stored in text files in the rc folder. I've seen php urls where its all like /something.php?someKindOfDataHere So would I be able to somehow pass the filename as some data in the url like index.php?gamedevpage And have it use EchoTextFromFile to echo all of the text from the file gamedevpage.txt into the main content block of the page? Or is that exactly what you are telling me not to do? If it's not then how would I do that?[/QUOTE] You could do it, but then any user could simply change that argument to something else, and your page would blindly echo whatever file they are telling it to echo. You could create a list of allowed files, and check whether the file is on the allowed list. Or place all the echoable files in one folder, and only make it echo files from that folder.
You can also use this: [php] $page = $_GET["page"]; if (file_exists("rc/$page.php")){ include_once("rc/$page.php"); } [/php] Or you can make a array and check if the page is in it.
[QUOTE=ThePuska;18110244]It directly gets data from the "address" of the page. If some other page is linking to page.php like this: [code]<a href="page.php?asd=file">link</a>[/code] And page.php has the code: [code]echo $_GET["asd"];[/code] page.php will echo "file" when an user clicks the link[/QUOTE] So if you did: page.php?asd=<img src=horrificimage.gif/> It would put horrificimage on the page? I can see why you wouldn't want that. [b]Edit:[/b] Forgot to check if you were on the ground before letting you jump, now if I hit space a lot I can fly :D
[QUOTE=iPope;18110380]So if you did: page.php?asd=<img src=horrificimage.gif/> It would put horrificimage on the page? I can see why you wouldn't want that.[/QUOTE] You can use this though, page.php?page=../../importantdocumentsnormalpeopleshouldnotbeabletoaccess.php
[QUOTE=ThePuska;18110365]and only make it echo files from that folder.[/QUOTE] I'll do that :D Thanks I'll parse the string from $_GET to remove all non alpha-numeric characters then throw an rc/ on the front which is folder with all of the content files in it. That way it's secure.
[QUOTE=Jallen;18110409]I'll do that :D Thanks[/QUOTE] Check the given input for any slashes to make sure users don't try to switch folders
[QUOTE=ThePuska;18110432]Check the given input for any slashes to make sure users don't try to switch folders[/QUOTE] You ninja'd my edit :argh: But yeah thanks :buddy:
Sorry, you need to Log In to post a reply to this thread.