Jump to content

th7nder

Banned
  • Posts

    8
  • Joined

  • Last visited

  • Feedback

    0%

About th7nder

Core X

  • BAN_NOTICE
    Yes

Informations

  • Gender
    Male

Recent Profile Visitors

954 profile views

th7nder's Achievements

Apprentice

Apprentice (3/16)

  • First Post
  • Conversation Starter
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

17

Reputation

  1. find out what's wrang, not going to tell, close
  2. hi! i've got problem with that: and uncle Google, doesn't care about it, cause he don't want to give me an answer, could you help me? please (;
  3. you've got no boost libs included/installed (;
  4. M2 Download Center Download Here ( Internal ) Hi! Today, i'm gonna give u simple tool, to remove all objects from map with one command, i think it's useful (; import os, sys try: directory = os.path.relpath(str(sys.argv[1])) dirs = [] except IndexError: print "usage: deleteObjects.py <mapfolder>" else: if os.path.isdir(directory): directoryListing = os.listdir(directory) for file in directoryListing: file = os.path.join(directory, file) if os.path.isdir(file): dirs.append(file) for dir in dirs: with open(os.path.join(dir, "areadata.txt"), "a") as f: f.truncate() f.write("AreaDataFilennnObjectCount 0") f.close() else: print "Maaan, directory " + directory + " doesn't exist" print "usage: deleteObjects.py <mapfolder>"
  5. u cannot convert from xml to sql, 'cause in xml there isn't enough data (;
  6. M2 Download Center Download Here ( Internal ) hi guys! i've recently created converter to item_proto, 2 sides XML->SQL and SQL->XML in PHP, i know it could be written better, but it works, that's the point right? XML->SQL: <?php header('Content-Type: text/html; charset=utf-8'); ini_set('display_errors', 'On'); error_reporting(E_ALL); $handle = 'item_proto.sql'; exec('echo '' > '.$handle.' && chmod 777 '.$handle); $file = fopen("item_proto.xml", "r"); if(!$file){ die("where is item_proto.xml?"); } while($line = fgets($file)){ if(strpos($line, "ItemProto")) continue; $line = explode("" ", $line); $insert = Array(); foreach($line as $lineExploded){ $lineExploded = substr($lineExploded, strpos($lineExploded, """) + 1); $insert[] = $lineExploded; } $set = Array("vnum", "name", "locale_name", "type", "subtype", "weight", "size", "antiflag", "flag", "wearflag", "immuneflag", "gold", "shop_buy_price", "limittype0", "limitvalue0", "limittype1", "limitvalue1", "applytype0", "applyvalue0", "applytype1", "applyvalue1", "applytype2", "applyvalue2", "value0", "value1", "value2", "value3", "value4", "value5", "socket0", "socket1", "socket2", "refined_vnum", "refine_set", "magic_pct","specular", "socket_pct", "addon_type"); $values = "SET "; for($i = 0; $i < count($insert); $i++){ if(count($insert) - 1 == $i){ $values .= '`'.$set[$i].'`=''.substr($insert[$i], 0, 1).'';'; } else { $values .= '`'.$set[$i].'`=''.$insert[$i].'', ';; } } file_put_contents($handle, "INSERT INTO `player`.`item_proto` {$values} n", FILE_APPEND | LOCK_EX); } echo 'item_proto.sql ready and steady, my friend!'; SQL->XML <?php header('Content-Type: text/html; charset=utf-8'); ini_set('display_errors', 'On'); error_reporting(E_ALL); $mysqli = new mysqli("localhost", "user", "passwd", "player"); if ($mysqli->connect_error) { die("and u think that mysql data is ok?"); } $handle = 'item_proto.xml'; exec('echo '' > '.$handle.' && chmod 777 '.$handle); file_put_contents($handle, "<ItemProto Version="1">n", FILE_APPEND | LOCK_EX); $andrw = $mysqli->query("SELECT * from `player`.`item_proto`"); while($data = $andrw->fetch_array()){ $converted = "<ItemDef Vnum="{$data['vnum']}" Name="{$data['vnum']}" LocalizedName="{$data['locale_name']}" Type="{$data['type']}" SubType="{$data['subtype']}" Weight="{$data['weight']}" Size="{$data['size']}" AntiFlags="{$data['antiflag']}" Flags="{$data['flag']}" WearFlags="{$data['wearflag']}" ImmuneFlags="{$data['immuneflag']}" Gold="{$data['gold']}" ShopBuyPrice="{$data['shop_buy_price']}" LimitType0="{$data['limittype0']}" LimitValue0="{$data['limitvalue0']}" LimitType1="{$data['limittype1']}" LimitValue1="{$data['limitvalue1']}" ApplyType0="{$data['applytype0']}" ApplyValue0="{$data['applyvalue0']}" ApplyType1="{$data['applytype1']}" ApplyValue1="{$data['applyvalue2']}" ApplyType2="{$data['applytype2']}" ApplyValue2="{$data['applyvalue2']}" Value0="{$data['value0']}" Value1="{$data['value1']}" Value2="{$data['value2']}" Value3="{$data['value3']}" Value4="{$data['value4']}" Value5="{$data['value5']}" Socket0="{$data['socket0']}" Socket1="{$data['socket1']}" Socket2="{$data['socket2']}" RefinedVnum="{$data['refined_vnum']}" RefineSet="{$data['refine_set']}" AlterToMagicItemPercent="{$data['magic_pct']}" Specular="{$data['specular']}" GainSocketPercent="{$data['socket_pct']}" AddonType="{$data['addon_type']}" />n"; file_put_contents($handle, $converted, FILE_APPEND | LOCK_EX); } file_put_contents($handle, "</ItemProto>", FILE_APPEND | LOCK_EX); echo 'item_proto.sql ready and steady mr Captain!!';
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.