Jump to content

Spectre

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Spectre's Achievements

Member

Member (2/5)

0

Reputation

  1. Hey guys and gals, I've got some code on a game I code for, nice and simple, it's just something as extra control of a navigation system. Simple thing, checks for a certain keypress, each key in the list will output a line into the URL to navigate. ?> <script language="javascript"> function getArrows(event) { arrows=((event.which)||(event.keyCode)); switch(arrows) { case 37: action = 'left'; break; case 38: action = 'up'; break; case 39: action = 'right'; break; case 40: action = 'down'; break; case 100: action = 'left'; break; case 104: action = 'up'; break; case 102: action = 'right'; break; case 98: action = 'down'; break; case 97: action = 'downleft'; break; case 99: action = 'downright'; break; case 103: action = 'upleft'; break; case 105: action = 'upright'; break; } window.location.href = "/quest.php?action="+action; } </script> <body onkeydown="getArrows(event)"> <? Now that's been working fine since I put it in like 2 years back? But suddenly it seems to not like to work in FF, a few users have reported this, mine was fine a few days back, but suddenly now is also spazzing, I believe since FF updated (i've had it open for weeks so it's not had chance until the other day to update to latest version). Any advice would be greatly appreciated, the navigation takes place on an grid from 0-80 on both axis, and the use of keyboard is much easier than clicking with mouse etc, so would really like to fix things >_<
  2. Still having problems with some people. People have to register in order to play the game and use chat etc. But IP banning is becoming pointless as they just find another proxy and use it. I really need a way to ban someone by their computer or something.
  3. Well this game has been going the best part of 6 years. And the same few undesireables keep on coming back, and it's just... infuriating. Was hoping there'd be something, a function someone has come up with to help. Before it drives myself as the lone coder and the staff team to the brink of sanity (not that i'm far off, code monkey and all)
  4. Hi there, I'm in serious need to find a way to block people from a website I code for. The thing is, we have a jailing system, nice and simple, and IP/email ban system too. But with proxies, advertisers and repeated troublemakers keep coming back because we just get the new proxy IP each time and it's a losing battle. What I need is a way to ban them properly from the site, like somehow stopping the computer they use from accesing the site. someone once said you can use a cookie to stop a browser getting on the site, but I don't know how to set it up to give the cookies out upon login and find the one associated to an account we don't want (by "cookie" banning I guess?") and stop them from logging in.
  5. I'll give it a whirl, thanks
  6. Ok, so here's the deal. I have a slot machine I've made in php, very simple, click buttons etc etc and it'll display the images, 3 reels, 10 images used on all 3, various win combos... what I'd LOVE to be able to do, is when the button is clicked to spin, the images come up, but before they actually finish up on the right image (images are gotten using 3 rand() vars) I'd like them to cycle the images, in the same fashion as a spinning reel on a slot machine would. Any ideas on how to accomplish this?
  7. Hi all, Need some help, what I'd like, is to be able to click a checkbox, then holddown shift key and click a box say... 5 down, and have it select all boxes between the first clicked box and the last clicked box, and then maybe miss a few boxes and repeat (and have it so it can be used to chekc and uncheck boxes in the same manner both up and down). I know this can be achieved in JS, but I'm A) not sure how to go about it and B) not sure how to modify the form/script (php) to use the JS when it's made. So js gurus... a little help here?
  8. Hey guys, I need a hand. I have a 3x3 table, and in each cell, is echoed out a specific image (based on id's of the cell and vars associated with those IDs) http://i32.tinypic.com/5layxw.jpg <<<< that's what it looks like (center square has mouseover it at the time of pic to show transparency stuff) Anyway, it all works fine, shows the right images for each coord as you move around, but... what I'd like to do, is add a second image over some squares (done with a small check) to overlay a .png over the jpg that's there already to denote a cetain thing there. The default grass tile for example: $img = '<img src=images/cs/grassthumb.jpg style="opacity:1;filter:alpha(opacity=100); position: relative; z-index:1;" onmouseover="this.style.opacity=0.6;this.filters.alpha.opacity=60" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=100" />'; how it's echoed: echo "<td id=\"$move\" $link >"; echo "$img </td>"; And all that works fine, but as I said I'd like to do: if($XX == $castlechk[x] && $YY == $castlechk[y]){ $img .= '<img src=images/cs/castle.png style="opacity:1;filter:alpha(opacity=100); position: relative; left: -80px; right: -80px; z-index:2;" onmouseover="this.style.opacity=0.6;this.filters.alpha.opacity=60" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=100" />'; } and although it "works" there's a problem of it having 80 extra px of black space, which as you can guess, REALLY messes with the table (makes it look like it's 4 columns instead of 3) This is in FF 2, not even checked other browsers yet. And I don't want to give absolute values for pos, because the little nav table moves, because there's other info above it always that can stretch the page down. So yeah, help? please?
  9. Thanks mike! With a little modding (count adding to echo out the cells in the right format) it works good Now if I can work the other bits I have in mind, I'll be set and can forget about this little pet project knowing it's done lol.
  10. I'm trying to pass table cell ID's as a var $cell for example, so I can do $move = $cell; and i've got code in place for $move to echo a certain link. My table is as follows right now (beware it's a mess right now) $img = '<img src=images/cs/grassthumb.jpg style="opacity:1;filter:alpha(opacity=100)" onmouseover="this.style.opacity=0.6;this.filters.alpha.opacity=60" onmouseout="this.style.opacity=1;this.filters.alpha.opacity=100" />'; if($move == "TL"){ $linky = 'wland.php?action=upleft'; } if($move == "TR"){ $linky = 'wland.php?action=upright'; } if($move == "BL"){ $linky = 'wland.php?action=downleft'; } if($move == "BR"){ $linky = 'wland.php?action=downright'; } if($move == "TM"){ $linky = 'wland.php?action=up'; } if($move == "BM"){ $linky = 'wland.php?action=down'; } if($move == "MR"){ $linky = 'wland.php?action=right'; } if($move == "MM"){ $linky = 'wland.php'; } if($move == "ML"){ $linky = 'wland.php?action=down'; } $onclick = 'onclick="window.location.href=\''.$linky.'\'"'; $link = $onclick; ?> <table align="center" cellpadding="0" cellspacing="0" id="navTab"> <tr> <td id="TL" <? echo $link;?>><? echo $img; ?></td><td id="TM" <? echo $link;?>><? echo $img; ?></td><td id="TR" <? echo $link;?>><? echo $img; ?></td> </tr> <tr> <td id="ML" <? echo $link;?>><? echo $img; ?></td><td id="MM" <? echo $link;?>><? echo $img; ?></td><td id="MR" <? echo $link;?>><? echo $img; ?></td> </tr> <tr> <td id="BL" <? echo $link;?>><? echo $img; ?></td><td id="BM" <? echo $link;?>><? echo $img; ?></td><td id="BR" <? echo $link;?>><? echo $img; ?></td> </tr> </table> <? Some help getting this working would be VERY helpful. Idea is to have a little 3x3 grid used to explore an area. I'm probably going about it all wrong though.
  11. Hi all, really hoping there's a JS whizzkid who can help me here. Basically, what I'm after is a 3x3 table like layout, with each cell being a picture (a small 80x80 image to act as a tile), easy enough right? Well then comes the reason for JS, exploration code. Basically, the middle square would be your current location, above everything will be echoed out your location, for example "You are at: $xco, $yco"; and any associated text which may happen on that square. The lil table bit below will show 9 squares, you in the middle, then by clicking on a square you MOVE in that direction, so for example, you click the right middle square, you move to $yco+1, moving up would be $xco-1, top right would be $xco-1, $yco+1 and so on. The middle square, should have an option to "enter" if needed, for when you're on a city square for example. Now I want the table to always update as you move, so the squares can change what image, if it's a square known to have a city in, as soon as it's within viewing distance (within the 3x3 square) it'll show the right image associated with those coords instead of the default grass tile I have. So if anyone could help with how I'd go about this, I'd be very grateful.
  12. Used your way, with a few tweaks (as I'm adding in paging to it etc) and works fine ( I knew it'd be simple but my brain was just not seeing it). Thanks for the help lol, much appreciated, and I now know not to code on so little sleep as I keep trying to make something simple, overly complicated.
  13. function tab($result){ while($tab = mysqli_fetch_assoc($result)) { tabrow($tab); } } function tabrow($row){ echo '<TR>'; echo '<td width="15">&nbsp</td>'; for($i = 1; $i<=4; $i++){ if($row[image] == "blank"){ $row[image] = 'image/achievement_locked.png'; } echo '<td><img src="'.$row[image].'" title="'.$row[alt_text].'"></td><td width="10"> </td>'; } echo'<td width="5"> </td>'; if($i%4==0){ echo'</tr>'; } } ?> <TABLE WIDTH="400" HEIGHT="450" ALIGN="center" STYLE="background-image: url('image/hutBK.png');"> <? tab($result); ?> <tr height="30"></tr> </table> <? Ok so there's my code snippet, i'm working on no sleep in 3 days (well other than an hour nap I managed) all i'm trying to do is make the table echo out in a 4 x 4 style (4 columns and 4 rows). But what it's doing is, echoing out the first thing 4 times, then new row, then 2nd thing 4 times and so on. I want it to show the first image, then 2nd, 3rd, 4th NEW ROW 5th 6th and so on, up to 16th and table ends... a little help please?
  14. I know how to make it change pages, my problem is making it echo the table out correctly. <TABLE WIDTH="400" HEIGHT="450" ALIGN="center" STYLE="background-image: url('image/hutBK.png');"> <tr><td width="15">&nbsp</td><td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="15"> </td> </tr> <tr><td width="15">&nbsp</td><td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="15"> </td> </tr> <tr><td width="15">&nbsp</td><td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="15"> </td> </tr> <tr><td width="15">&nbsp</td><td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="10"> <td><img src="image/achievement_locked.png" title="Locked Achievement!"></td><td width="15"> </td> </tr> <tr height="30"></tr> </table> Ok so that there is what the table will need to be set up like (it's my test table I was doing with obviously manual cell entries to get my spacing sorted) That's what it looks like. Now what I want is, to select all the rows from the achievements table, and echo out as per the above, each will appear like above until the achievement is unlocked, and at that point, by using a check against pachievements table it'd echo the actual image path from the achievements table instead of the locked image, and well will do that for all the cells (check to see if player has the achievement and echo the cell with the right image, else echo the cell from above example showing the locked achievement. I just can't wrap my head around it (considering some of the things I have achieved, this is just annoying as I know it should be simple but my mind keeps going blank)
  15. I'm working on a little project, just a one page thing, for showing awards earned by a player. Now I have a table, with set size, with a background image of shelving I made for each award to sit on (as an image with a variable of the title of the image). Now the thing is, there can be 16 trophies/awards on one set of shelving, and I'm planning on a paged thing so to start there will be at least 3 pages, so 48 trophies/awards, 16 on page 1, another 16 on page 2 (from id 17 onwards) and same again on page 3. I have it set up as two tables in the db, one holding the 48 rows of achievements (id, image, name, alt_text), and a player table of that showing id, userid, achievement id (a_id). Basically so a player can unlock them as they go and change the image from the silhouette image of a trophy I made, to the actual image with title involving the name and a player stat. Now to my problem, well not so much problem as my brain just saying "I'm not gonna think too well on this". I need to be able to echo out the rows correctly. So that row 1 with it's TD's will echo out on page 1, IDs 1-4 of the awards, row 2 would do the same but echoing 5-8 and so on. But last time I tried something akin to this with a foreach and while it just did it like row 1 was only showing id 1, 4 times, row 2 did id 2 4 times etc... So I ask for any help in creating the function or while/foreach loops correctly so it does as I want with the page numbers working as the limiter to start the id numbers, and it echos out each item correctly.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.