Template:Sdk minimal example: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
(Created page with ":''This is a minimal program example which contains no error checking'' <c> #include <vpsdk/VP.h> #include <stdio.h> #include <stdlib.h> #define Username "User" #define Passw...")
 
m (example fix)
 
Line 25: Line 25:
</c><noinclude>
</c><noinclude>
== Usage ==
== Usage ==
This template should be {{code|subst:}}'d into the article to dump a copy of the above code in it, for modification by using: {{code|<nowiki>{{subst:sdk minimal example))</nowiki>}}
This template should be {{code|subst:}}'d into the article to dump a copy of the above code in it, for modification by using: {{code|<nowiki>{{subst:sdk minimal example}}</nowiki>}}


[[Category:Subpage templates]]
[[Category:Subpage templates]]
</noinclude>
</noinclude>

Latest revision as of 04:10, 25 August 2013

This is a minimal program example which contains no error checking

<c>

  1. include <vpsdk/VP.h>
  2. include <stdio.h>
  3. include <stdlib.h>
  1. define Username "User"
  2. define Password "1234"
  3. define World "VP-Build"

int main(int argc, char ** argv) {

   vp_init(VPSDK_VERSION);
   VPInstance sdk = vp_create();
   vp_connect_universe(sdk, "universe.virtualparadise.org", 57000);    
   vp_login(sdk, Username, Password, "VPBot");
   vp_enter(sdk, World);    
   vp_state_change(sdk);
   
   while(vp_wait(sdk, 1000) == 0){}
   return 0;

} </c>

Usage

This template should be subst:'d into the article to dump a copy of the above code in it, for modification by using: {{subst:sdk minimal example}}