Jump to content
Ding

Coding a Hatchery

Recommended Posts

@Rebsingh

 

I saw this link mentioned a few times on other posts a while ago, I don't know if it will help or not but it's all about using DC's API I believe. Hope it's what you're looking for!

 

 

 

http://dragcave.net/api.txt

Share this post


Link to post

Now its time to learn php, if you realy want to do a real hatchery/er on base of the api. But first you should start learning html and css, the absolute basics of every website. I don't think will take any advantage from the api unless you allready masterd php, and that may take at least some months until you know php good enough or even longer when you never programmed anything before.

Share this post


Link to post

Things I have done:

 

1. Gotten API Access

2. Learned HTML pretty well

3. Know how to load PHP on a website

4. Gotten my own website that can handle PHP (DC-MM

 

THings I need done:

 

1. Learn a lot more about PHP

2. Code a hatchery and ER

3. HELP

4. A guide to PHP (Please can someone post one? or two?)

 

Thanks

Edited by Rebsingh

Share this post


Link to post
Now its time to learn php, if you realy want to do a real hatchery/er on base of the api. But first you should start learning html and css, the absolute basics of every website. I don't think will take any advantage from the api unless you allready masterd php, and that may take at least some months until you know php good enough or even longer when you never programmed anything before.

I couldn't agree more, just looking over that api text file it's basically greek to me. It's really all building blocks, one concept stack onto another. And you really have to start from the ground up.

 

Btw, Ext3h I have to say I'm immensely impressed with what you've done with your hatchery site. I wish I knew coding as well as you do, you make it look so easy haha.

It's really inspiring. As is any of the hatchery sites really, but I wanted to say well done!

 

 

 

Share this post


Link to post
Things I have done:

 

1. Gotten API Access

2. Learned HTML pretty well

3. Know how to load PHP on a website

4. Gotten my own website that can handle PHP (DC-MM

 

THings I need done:

 

1. Learn a lot more about PHP

2. Code a hatchery and ER

3. HELP

4. A guide to PHP (Please can someone post one? or two?)

 

Thanks

Hey you know what we could do...I could edit my first post and add some links from this whole conversation, and add anything that I find around the net. Don't know if it'll help but might as well right?

 

Also if anyone has any other information, guides, advice, we could add it?

Share this post


Link to post
Hey you know what we could do...I could edit my first post and add some links from this whole conversation, and add anything that I find around the net. Don't know if it'll help but might as well right?

 

Also if anyone has any other information, guides, advice, we could add it?

Omg YEA. biggrin.gif That would help many others.

 

This is what I have so far. It is Javascript and the Add Dragon button doesn't do ANYTHING... yet.

 

http://dcmm.webege.com/ertest.php

Share this post


Link to post

THings I need done:

4. A guide to PHP (Please can someone post one? or two?)

Right in the fourth post of this very thread...

 

If you chose to use PHP as I did, and as most sites do (including DC), then you can have a look at this site: http://www.php.net/

 

If you want some mysql help, I would say have a look at this site:  http://www.pantz.org/software/mysql/mysqlcommands.html

 

But with those two links, plus some html (css optional), then you can make a self serve hatchery.

Share this post


Link to post
Right in the fourth post of this very thread...

 

Oh thanks bbik. biggrin.gif I'll look at that.

Share this post


Link to post
http://selfhtml.org/ for learning basic html and most of css. Not very interesting to read, but a least usefull. As soon as you know the basic structure of html and css you may start in learning php, but in this case it's not only php, its programming in general. Try http://tut.php-quake.net/en/ for a VERY EASY access to php. And after you understood that (not only copied the examples but beeing able to actually USE it) its time to start with mysql or another sql-base database (Do NOT choose the microsoft sql server). You may continue as soon you can explain and use the Keywords JOIN and UNION freehanded. Now you know the absolut basics and you should continue doing a lot of practise, its best to write your own little browsergame for the beginning as you will get a rough feeling what traps there exists, and it should warn you: Their are hundreds of common mistakes and security issues using methods you never even heard of (Just an example, some of the new hatcheries are not protected against so calld "sql injections" which would allow me to destroy the whole site within seconds). Until this point at least 1 year hast past by, and if you still like to lern programming, then good luck!

Share this post


Link to post

http://selfhtml.org/ for learning basic html and most of css. Not very interesting to read, but a least usefull. As soon as you know the basic structure of html and css you may start in learning php, but in this case it's not only php, its programming in general. Try http://tut.php-quake.net/en/ for a VERY EASY access to php. And after you understood that (not only copied the examples but beeing able to actually USE it) its time to start with mysql or another sql-base database (Do NOT choose the microsoft sql server). You may continue as soon you can explain and use the Keywords JOIN and UNION freehanded. Now you know the absolut basics and you should continue doing a lot of practise, its best to write your own little browsergame for the beginning as you will get a rough feeling what traps there exists, and it should warn you: Their are hundreds of common mistakes and security issues using methods you never even heard of (Just an example, some of the new hatcheries are not protected against so calld "sql injections" which would allow me to destroy the whole site within seconds). Until this point at least 1 year hast past by, and if you still like to lern programming, then good luck!

Thanks. I love how all the people here are helping each other out. Well I don't know how to code PHP or anything so is most of what I will need in that tutorial that you gave? I'm pretty good with HTML.

 

I just realized something. I put the API key and everything into that Submit box I made. At the end (of the key) do I do view/$varwhatever and in the submit box I make it so whatever the person entered is the variable so then the variable could be Dragon Code and it would be like $var = QARg and then the API thing would add the dragcave.net/api/********/xml/view/$var and the $var would turn into QARg? How would I code that?

Edited by Rebsingh

Share this post


Link to post

No, the tutorial will NOT cover the things you need, it covers absolut basics only. Coding an hatchery requires more knowledge then a simple tutorial could give you. Without full understanding of databases and standard programming concepts you have rather poor chances in even producing a moderated only hatchery.

 

Try something easier for the beginning, it's not that hard any more once you've got some practice.

Share this post


Link to post
No, the tutorial will NOT cover the things you need, it covers absolut basics only. Coding an hatchery requires more knowledge then a simple tutorial could give you. Without full understanding of databases and standard programming concepts you have rather poor chances in even producing a moderated only hatchery.

 

Try something easier for the beginning, it's not that hard any more once you've got some practice.

What should I train with? I just need to know what I can do.

Share this post


Link to post

Can any proffessional coder give us a general layout of what we should include?

 

Sorry if I sound like a noob... I have been looking at PHP codes for like 3 days straight and tried them all out and NONE of them work. I feel like quitting. I want to make it so that you have a text box and you enter the code in and you click Add Dragon. And then the $_POST thing is inputted with the Dragon Code you entered and then there is the dragon cave thing like dragcave.net/view/$var and the var is what you inputted and yea.... This is so freaking annoying. I want to hit something.

 

I got the above thing to work... but it kept adding ?= to it. So if the code was LorN it would be Dragcave.net/view/?=Lo because the limit is 4 digits and all so I couldn't get rid of that. I'm going to have to hit something.

 

HELP?

Share this post


Link to post
I'm going to have to hit something.

 

Oh I hear ya. PHP makes me want to go on a slapping rampage.

Sorry I can't help you with your problem though. I'm currently hung up on building a script that will auto-remove eggs if they're in the system for longer then say 3 days or so.

 

 

What exactly do you have right now? Maybe if someone can look your codes over they might be able to find any problems. Unless you want to keep your codes to yourself that's fine too, no pressure wink.gif

 

 

 

Share this post


Link to post

Oh I hear ya. PHP makes me want to go on a slapping rampage.

Sorry I can't help you with your problem though. I'm currently hung up on building a script that will auto-remove eggs if they're in the system for longer then say 3 days or so.

 

 

What exactly do you have right now? Maybe if someone can look your codes over they might be able to find any problems. Unless you want to keep your codes to yourself that's fine too, no pressure  wink.gif

Truthfully, I don't have anything. I haven't made an add dragons thing, I haven't made an ER page, I haven't made a frame where the clicks show up.

 

I don't know how to do ANYTHING. That is why I came here. Seems like you have a hang of it. Did you know any PHP before you started this topic?

 

Would anyone like to contact me on the IRC to offer some help? sad.gif

 

Yea and all I have is this stupid little box that doesn't do anything: http://www.dcmm.webege.com/ertest.php

Edited by Rebsingh

Share this post


Link to post

None at all.

 

I've been just going over these sites for about three days straight just working on the tutorials and it's helped me get a better grasp of what's going on. but it's only the tip of the iceberg you know?

 

So far I now know how to make databases on a server, make tables, and how to enter data onto those tables, how to delete data from those tables and how to do this either directly using the MySQL console or through PHP scripts.

 

Which, has the makings of a hatchery sort of, but it's so bare bones, there's a lot more I need to learn. haha I'm not expecting to get this hatchery site up for quite a long time honestly.

 

 

Share this post


Link to post

I have been looking at PHP codes for like 3 days straight and tried them all out and NONE of them work.

I got the above thing to work

Truthfully, I don't have anything.

For starters, it would help to be clear on what you do or don't have. It's rather useless to complain about code not working, if you don't even have code. ?= is typically a GET thing, though, from what I've come across, so are you sure you didn't mix those up somewhere?

 

Beyond that, you need to be specific. Even if only in a text file on your computer, be specific. If you don't know exactly what you want to happen, you won't be able to make it happen. Do you want people to enter a scroll name? Or a code? Multiple codes? And then what? Submit them? Only submit them in certain cases? What cases? What should happen when someone submits codes? Nothing, as far as the user sees? A success message? A failure message? A different result depending on the action taken? What results, and for what actions? Sort out the details for everything, one section at a time. THEN you can work on getting the code, and what happens on the coding end, where, when, how. Look up if statements, loops, comparisons, dozens of other things, and read. Read it again. And again. Find an explanation of that same thing on another site or three, and read those a few times. Make sure you understand how it works, and how to make it work, and then go try using it. And then read some more when it doesn't work, to figure out what tiny yet very important detail you missed, which is causing the whole thing to break in a major way. Take a break and ignore it for a couple days if you still can't see anything wrong after ages looking for the problem. Sooner or later, it'll turn up, or you'll have a new idea of how to find a solution, and you'll be able to continue.

 

And above all, make sure you remember that it's not a human with a brain determining how the code should act. It can only do what you tell it to, not what you think it should do, so make sure you tell it exactly what you want.

Share this post


Link to post
None at all.

 

I've been just going over these sites for about three days straight just working on the tutorials and it's helped me get a better grasp of what's going on. but it's only the tip of the iceberg you know?

 

So far I now know how to make databases on a server, make tables, and how to enter data onto those tables, how to delete data from those tables and how to do this either directly using the MySQL console or through PHP scripts.

 

Which, has the makings of a hatchery sort of, but it's so bare bones, there's a lot more I need to learn. haha I'm not expecting to get this hatchery site up for quite a long time honestly.

Do you have a website you are running it on? Maybe you and I could join forces like Blaz and I. Blaz knows lots of HTML, Javascript, and CSS. I know LOTS AND LOTS of HTML. (And some PHP) We could be like Co-Admins on the site.... Just maybe. I want to see what you think. biggrin.gif

Share this post


Link to post
Do you have a website you are running it on? Maybe you and I could join forces like Blaz and I. Blaz knows lots of HTML, Javascript, and CSS. I know LOTS AND LOTS of HTML. (And some PHP) We could be like Co-Admins on the site.... Just maybe. I want to see what you think. biggrin.gif

Nah I'm just running this stuff offline using WAMP so I can see what everything does without it being out there for people to access just yet. Really just to learn from until I actually have the coding skills to build the site and then I'll find a host that can handle the traffic.

 

 

Joining forces does sound very tempting, but at the moment I don't really have anymore to offer then what I've posted here. It's really all I know.

I've got a pretty strong grasp on HTML and CSS too but that's about it.

lol I'm still quite the noob when it comes to servers and all that good stuff. biggrin.gif

 

 

 

 

Share this post


Link to post
Nah I'm just running this stuff offline using WAMP so I can see what everything does without it being out there for people to access just yet. Really just to learn from until I actually have the coding skills to build the site and then I'll find a host that can handle the traffic.

 

 

Joining forces does sound very tempting, but at the moment I don't really have anymore to offer then what I've posted here. It's really all I know.

I've got a pretty strong grasp on HTML and CSS too but that's about it.

lol I'm still quite the noob when it comes to servers and all that good stuff. biggrin.gif

I have my own MySQL server and ftp file server. I can let you in on Blaz and I's project. All of us don't really know much on PHP but if we work together, more will get completed. biggrin.gif

 

All I really know in PHP is: variables, echo, and adding HTML thingys. I don't even know how to use the API. I don't recall you saying you have access, so if you join me, you can use my pass because we would be working on the same site. I have access to the API. Well thanks and please consider. xd.png

Share this post


Link to post

Alright. I just ran through something COOL. I did this on my own: http://dcmm.webege.com/ertest.php

 

It doesn't add dragons to the ER but I made the enter code a variable like I wanted it to and then I added the IMG SRC="dragcave . net/image /'.$var$.'.gif"> and that TOTALLY WORKED. I was so freaking excited. Next I made the image a Hyperlink and Replaced that old one (The Add My Dragon that didn't work) with this one. This isn't the ER and this doesn't have anything to do with the API but still. It's pretty sweet. biggrin.gif

Edited by Rebsingh

Share this post


Link to post

On the page that I did, I made the text limit 4 and I made the image clickable. SCORE. This is a giant step towards... whatever my goal...? But yea. biggrin.gif This is the first real thing I have done even though it is useless. It looks COOOOOOL. biggrin.gif

 

IMPORTANT: I need to know an AutoRefresh code that saves your post data because I hate having to click Want to save Post Data? every second. Can someone supply a code? I can't find one.

Edited by Rebsingh

Share this post


Link to post

You kneed to know mysql in order to save the dragons. So have a look on tutorials for this topic wink.gif

Share this post


Link to post
You kneed to know mysql in order to save the dragons. So have a look on tutorials for this topic wink.gif

I just created a MySQL database. Now I need to make.. a table? It is asking me for how many fields. I put 2 for no reason but now it has a bunch of weird stuff. sad.gif

Share this post


Link to post


  • Recently Browsing   0 members

    • No registered users viewing this page.