
InternalExpertCoding
Members-
Posts
34 -
Joined
-
Last visited
-
Days Won
1
Content Type
Profiles
Forums
Events
Everything posted by InternalExpertCoding
-
I like the idea of not submitting the users name to the trading market. As one said above, it keeps user's from being attacked immediately after the item is bought. In my opinion, I would create a preference to turn on/off the option to link your username to the market. Simply because, Some user's will only buy to help out other user's. So, therefore, an option would be nice to have.
-
In-depth Guide/Tutorial For PHP (Part One)
InternalExpertCoding replied to InternalExpertCoding's topic in Tutorials
____Update ____ Strings & String Literals. Say What? String: A sequence of characters that is used to collect data. String Literal: String that appears in the actual source code. Therefore, <?php Echo ‘Hello World’; ?> Hello World, Is a string literal. Most of all string literals are enclosed by single or double quotes. As I mentioned there is not much of a difference there earlier. Variables ($myVariable) So, Variables, What do they do and why? Well, Variables are made to store specfic data in a code therefore, you can perform some type of operation on it. So, a variable is simply a storage location in memory, and is represented by a name. For example: <?php $myVar1 = 2; $myVar2 = 3; $result = 7; $myVar1 * $myVar2 = $result ?> $myVar1 is simply storing the numerical value “2”. $myVar2 is storing the numerical value “3”. And $result is storing the numerical value “7”. Therefore, I can process an operation like: $myVar1 * myVar2 = $result Using just variables. In which, later on, if I want to change the script to execute a different mathematical function, I would only have to change my variables. Which is an easy reference. Now, Let’s take a look at the way I have named my variables. $myVar1 $myVar2 $result Now, In any language, The Syntax allows you to name your variables to whatever is suitable for what action your processing. But, there are some restrictions on naming variables also. Like, Variable names cannot contain spaces. Most programmers use a method called camelCase to make the variable name more readable. As you see about, I have used camelCase. Example: $myVar1 Which, I will be using this method through my tutorial, As it makes reading the variable name much easier. Another way to easily read the variable name while using multiple words is to separate them using a underscore. Example: $my_Var So, Either of those two ways are ones I perfer to use when naming a variable. Now, You have been looking at quite a few variable names here. I guess you are wondering what the “$” stands for? The Dollar sign indicates that this is a storage variable. Which, In PHP, you must always use the $ to declare the variable. __UPDATE, Finishing of variables__ Continued: Variables and Variable Assignments As you seen before, $myVar1 = 2; $myVar2 = 3; $result = 7; Was used. Setting each variable with a specific numerical value. This method is called assignment statements. For example: <?php $myVar1 = 25; echo ‘I have ‘ .$myVar1. ’ dollars in my bank account’; ?> // This code used as your input //For input (Refer back to the last section) ?> So, your output on the page would be. I have 25 dollars in my bank account -
In-depth Guide/Tutorial For PHP (Part One)
InternalExpertCoding replied to InternalExpertCoding's topic in Tutorials
Thanks DJK, More to come soon. :) -
Might Be an old topic Or might not be, not sure lol... But anyways, When I owned games. I did something like.... On Input (Cash, Crystals, Special Items) Such as, On streets. Or something similar Was.. For everything a user gets. Through Streets, Markets, Donator Packs, I would insert them into a table via database. So, I would have a table called (user_econ) On Output I would update the table And insert data into a new table So, INSERT INTO user_econ UPDATE out_inflation And Log that Information Doing a few algorithms, I had a forumla to calculate the average percentage of the games econ. In my case, I would keep it around 13%. So I would add if$ir['bank'] AND $ir['cyberbank'] > XamountofCash); { // Code here, And Divide by 3 } Hard to explain really. But, It kept the game's economy at a low min. Which worked for me. Took alot of math and calculations to make it though
-
Okay, So let's get started on just some basics. Input: Any Data the computer collects from user's or device's Output: Any Data the Computer,Program,Script Produces or Visually Shows to User's ASCII "askee": Developed sometime in the early 1960's. The ASCII Character Set defines codes for 128 characters. (Will Post them all at the end of the segment). Therefore, In the early 1990's, Something called Unicode was developed. Unicode: Encoding scheme that is compatible with the ASCII Character set, But Unicode represents every character in any programming languages to this date. Unicode is now the "standard" character set used today. PHP: A High Leveled Language: There are many high-leveled languages out there. From, C,C++,And even Javascript. Each high-leveled language has its own set o words a programmer must learn before using the language. These are known as reserved words or key words. Every key word, or reserved word has a specific meaning to it, And CANNOT, I repeat CANNOT be used as anything other than what it is defined for. Some other things that high-leveled languages have are: Operators Syntax Punctuation Statements And many others. Operators perform various operations through data. Such as Algorithms. Or, math operations. Such as ( 2*2 = 4) Syntax, Now, This is a big one. Syntax is a set of rules that are meant to be strictly followed when developing a script. So, What does the Syntax rules do? Well, Generally, They dictate how key words,operators, and punctuation characters should be used in a program. Learning the Syntax of the language is the FIRST step in learning the language of your choice. ********UPDATE...Added in Starting and ending Syntax***** As requested, I will go over the starting and ending syntax for PHP. First off, There are 2 different ways that can be used when starting PHP code, Only one I recommend though. <? // Starting and ending Syntax. I don’t recommend. ?> And, <?php // Starting and ending Syntax I do recommend. ?> So, What’s the difference? Well, Orginally, During PHP first years of development <? ?> Was used. Which was pretty simple and fast to write. Although, In today’s world. <?php ?> Is used. But why? Well, <? ?> Makes your parser do a lot more work to consider it is PHP code. The starting and ending syntax always tells your parser what type of code is going to be executed. Therefore, <? ?> Or, <?php ?> Can be used. Using the <?php ?> Method allows the parser to do less work to find out what type of code is going to be executed. Simply because, This method is the strict syntax in PHP now, As The Second method was Strict in earlier times of PHP. So, during the tutorial, As I said, I will be using the recommended, <?php ?> Statements are simply instructions that are used when writing a script. This can consist of the following: Key Words, Operators, Punctuation, and Other Allowable programming elements. In which, They must be arranged in the correct sequence to perform the operation properly. The statements that a programmer writes are called source code, or for simple, code. So, per say you have written a statement. consisting of: Statements <?php show 'Hello World'; ?> This above code will give you a syntax error. Which is simply a mistake in the source code, showing an error on the designated page. <?php echo 'Hello World'; ?> Would not give an error. As an "echo statement", Is 1 of two correct ways to properly display writing on a page. <?php print "Hello World"; ?> Would be the second correct way to execute and properly display writing on a page. Take Notice at what I have changed here. 1. Changed echo to print 2. Changed Single quotes to Double Quotes Now, Many expert programmer's would get into a fight about why to use echo over print, or vice-versa. And, Might also do the same thing over single quotes vs. double quotes. But, I am not. Both are proper syntax rules to display content on a page. So, overall, there are 4 proper ways to correctly display the content on a page. 1. <?php echo 'Hello World'; // Echo Statement Using Singles ?> 2. <?php echo "Hello World"; // Echo Statement Using Doubles ?> 3. <?php print "Hello World"; // Print Statement Using Doubles ?> 4. <?php print 'Hello World'; // Print Statement Using Singles ?> Back to syntax and syntax errors. As I was writing this up, I originally was going to write up syntax errors and post their meanings. But I found this: http:// http://php.syntaxerrors.info/index.php?title=Call_to_undefined_function So, As I said before, Syntax dictates how key words, operators, etc should be used in a script. Therefore, If any syntax rules are broken, A Syntax Error will occur and display on the designated page showing 1 of the errors explained in that website. But! Say, you are writing a script. Generally, Every script will contain at least 1 syntax error. Even if its coded by the best. Simply Mistakes such as spelling or a missing (;) Could trigger these errors. So, If you get any of those errors, don’t let it bring you down. Think of it as a incentive to do better. Now, The code is up and running and in executable form. It is now tested by you for logical errors. Logical Errors: Does not keep the program from running, But, It does keep it from producing correct results. One of the most common logical errors are mathematical mistakes. Such as: <?php 2*2 = 19; ?> Clearly there you can tell there is a logical error. As, I am not showing full codes it is quite difficult to explain. But I will show you a code that does have logical errors in it, But! The code will show things I have yet to go over. <?php $myVar1 = 2 $myVar2 = 3 $result = 7 $myVar1 * $myVar2 = $result ?> Now as you can tell. 2 (*) 3 does not equal 7. Therefore, processing a logical error. So, You don’t want to keep it this way do you? Nope, So the next step is to go back into the source code and debug it. Debug: Simply means that you go back into the code, Find and correct the logical errors. Input: Anything the Script takes action to. Output: Displayed Content Input is simply anything that the user does to provoke the script the execute. Such as, When you log-in into a game, or website. And you must click “Log In”, Or “Submit”, You are sending 1. Your User Name , and 2. Your Password to the database. In nearly all cases it will go somewhat like this: 1. User Enters Username 2. User Enters Password 3. User Submits Input (“Log In”) 4. Authenticates The Username and Password are Correct 5. Inserts some Content into the database Output can contain anything from a website showing images, To it showing you something. Before, I posted 4 methods that a Statement can be displayed. That in which, Would be considered output. So, As I am doing this section over logging in to a game. <?php echo ‘You are Now Logged In, Redirection’; ?> So, The steps above now change. 1. User Enters Username 2. User Enters Password 3. User Submits Input (“Log In”) 4. Authenticates The Username and Password are Correct 5. Inserts some Content into the database 6. Output is now inserted “ You are Now Logged in, Redirection” The output will be showed on the page, allowing you to read that statement. Please, Note: The Quotes (either single or doubles) Are not displayed. They are simply mark the start of the output, and the end of the output. Therefore, being fully closed by a semi-colon ( ;) As I forgot to mention earlier, While writing a source code, The code executes from top to bottom. Which is very important to know. So, A set of statements that are executed from “TOP TO BOTTOM” are called sequence structures. Hence the name (Sequence), It will simply tell you that there is some order there. This Concludes the First Part. As I don't have time to write the rest of it up yet. Back with more later. Please Comment :) Quick Update :)
-
Sorry to say, But it could be something as easy as the way you deliver to the next page. Possibly you refreshed during the attack? Or maybe before you won the fight you went to a different URL? Or it could just be something in your script.
-
Let me point out to all, There is a simplier and more effcient way to claim as a sucessful game. Now, Let me say here, Kyle, Has done a great job explaining, And it should help somewhat. But! I would like to add one thing that most game owner's don't really look at. When you start a game, You begin putting pocket money into it. Therefore, Before you really have a sucessful game, you will need to make at least 1/4 profits back in than what you are putting into the game. For example, Hosting, Mods, Etc etc. You will want to begin making at least 1/4 profits at the end of the week,month,year. Whichever way suits you better. Its just like a business, Any business is not a sucessful business until they have made the profits and income to support the business without worrying. I would also like to say about the Admin's playing the game. In the foremost games that I have owned, I DO NOT let my admins play. Why? Well it's simple. If an admin is playing the game, Someone new comes up, or even someone who has been playing awhile and says: " Wow, That admin must be cheating, I cant catch him in stats or nothing". And then that drives away players. I created a code long ago, Where if the chosen staff is hired, I add thier name to a list in the code, and boom!, They then cannot play, They may view everything as if they where playing, But as far as handling money etc etc, They cannot. When I own a game, And People want to be staff, If I do hire them, I mark there name on the code, Therefore, They have no choice but to be a staff member.
-
Does 'nice URL's' really matter?
InternalExpertCoding replied to Swift-Fusion || Fusion's topic in General
To get back on track, For the URL, Yes, Actually it does matter to some point. Does the Users Notice it? Answer: Very Possible Why? Maybe the user types in the URL everytime, And Per say the URL is: http://www.domain.com/folder/game/index.php The user typing in a long URL everytime will soon get old. And also, You want the URL to have something catchy. That way the user ALWAYS remembers the game name. :)