Plus to Arcturus convert scripts

Results 1 to 6 of 6
  1. #1
    Death from above! The General is offline
    The OmegaRank
    Aug 2011 Join Date
    8,728Posts

    Plus to Arcturus convert scripts


    RaGEZONE Recommends

    RaGEZONE Recommends

    Use at your own risk, no support will be given. Only COPIES data from plus to Arcturus. Doesn't modify your plus database.

    Converts:
    bots,
    pets,
    users
    catalog
    furniture
    rooms
    items
    friends
    credits/pixels/points
    badges
    achievements
    guilds

    Code:
    # Converts a plus database to arcturus.
    # Name your original database plus.
    # Name your arcturus database arcturus.
    
    # Define some helper functions.
    CREATE FUNCTION SPLIT_STRING(str VARCHAR(255), delim VARCHAR(12), pos INT)
    RETURNS VARCHAR(255)
    RETURN REPLACE(SUBSTRING(SUBSTRING_INDEX(str, delim, pos),
            LENGTH(SUBSTRING_INDEX(str, delim, pos-1)) + 1),
            delim, '');
    
    # Create a copy of the original items_base table for reference.
    RENAME TABLE arcturus.items_base TO arcturus.items_base_backup;
    CREATE TABLE arcturus.items_base LIKE arcturus.items_base_backup;
    
    TRUNCATE TABLE arcturus.achievements;
    TRUNCATE TABLE arcturus.achievements_talents;
    TRUNCATE TABLE arcturus.bans;
    TRUNCATE TABLE arcturus.bots;
    TRUNCATE TABLE arcturus.bot_serves;
    TRUNCATE TABLE arcturus.camera_web;
    TRUNCATE TABLE arcturus.catalog_clothing;
    TRUNCATE TABLE arcturus.catalog_featured_pages;
    TRUNCATE TABLE arcturus.catalog_items;
    TRUNCATE TABLE arcturus.catalog_items_limited;
    TRUNCATE TABLE arcturus.catalog_pages;
    TRUNCATE TABLE arcturus.chatlogs_private;
    TRUNCATE TABLE arcturus.chatlogs_room;
    TRUNCATE TABLE arcturus.commandlogs;
    TRUNCATE TABLE arcturus.crafting_altars_recipes;
    TRUNCATE TABLE arcturus.crafting_recipes;
    TRUNCATE TABLE arcturus.crafting_recipes_ingredients;
    TRUNCATE TABLE arcturus.emulator_errors;
    TRUNCATE TABLE arcturus.gift_wrappers;
    TRUNCATE TABLE arcturus.groups_items;
    TRUNCATE TABLE arcturus.guilds;
    TRUNCATE TABLE arcturus.guilds_forums;
    TRUNCATE TABLE arcturus.guilds_forums_comments;
    TRUNCATE TABLE arcturus.guilds_members;
    TRUNCATE TABLE arcturus.hotelview_news;
    TRUNCATE TABLE arcturus.items;
    TRUNCATE TABLE arcturus.items_base;
    TRUNCATE TABLE arcturus.items_crackable;
    TRUNCATE TABLE arcturus.items_hoppers;
    TRUNCATE TABLE arcturus.items_presents;
    TRUNCATE TABLE arcturus.items_teleports;
    TRUNCATE TABLE arcturus.marketplace_items;
    TRUNCATE TABLE arcturus.messenger_friendrequests;
    TRUNCATE TABLE arcturus.messenger_friendships;
    TRUNCATE TABLE arcturus.messenger_offline;
    TRUNCATE TABLE arcturus.navigator_publics;
    TRUNCATE TABLE arcturus.permissions;
    TRUNCATE TABLE arcturus.polls;
    TRUNCATE TABLE arcturus.polls_answers;
    TRUNCATE TABLE arcturus.polls_questions;
    TRUNCATE TABLE arcturus.recycler_prizes;
    TRUNCATE TABLE arcturus.rooms;
    TRUNCATE TABLE arcturus.room_bans;
    TRUNCATE TABLE arcturus.room_enter_log;
    TRUNCATE TABLE arcturus.room_game_scores;
    TRUNCATE TABLE arcturus.room_models;
    TRUNCATE TABLE arcturus.room_models_custom;
    TRUNCATE TABLE arcturus.room_mutes;
    TRUNCATE TABLE arcturus.room_promotions;
    TRUNCATE TABLE arcturus.room_rights;
    TRUNCATE TABLE arcturus.room_trade_log;
    TRUNCATE TABLE arcturus.room_trade_log_items;
    TRUNCATE TABLE arcturus.room_votes;
    TRUNCATE TABLE arcturus.room_wordfilter;
    TRUNCATE TABLE arcturus.special_enables;
    TRUNCATE TABLE arcturus.support_tickets;
    TRUNCATE TABLE arcturus.users;
    TRUNCATE TABLE arcturus.users_achievements;
    TRUNCATE TABLE arcturus.users_achievements_queue;
    TRUNCATE TABLE arcturus.users_badges;
    TRUNCATE TABLE arcturus.users_clothing;
    TRUNCATE TABLE arcturus.users_currency;
    TRUNCATE TABLE arcturus.users_favorite_rooms;
    TRUNCATE TABLE arcturus.users_pets;
    TRUNCATE TABLE arcturus.users_recipes;
    TRUNCATE TABLE arcturus.users_settings;
    TRUNCATE TABLE arcturus.users_wardrobe;
    TRUNCATE TABLE arcturus.user_window_settings;
    TRUNCATE TABLE arcturus.vouchers;
    TRUNCATE TABLE arcturus.wired_rewards_given;
    TRUNCATE TABLE arcturus.wordfilter;
    TRUNCATE TABLE arcturus.youtube_items;
    TRUNCATE TABLE arcturus.youtube_playlists;
    
    INSERT INTO arcturus.achievements SELECT id, group_name, category, level, reward_pixels, 0 as reward_type, reward_points, progress_needed FROM plus.achievements;
    INSERT INTO arcturus.bots 
    	SELECT 
    		plus.bots.id, user_id, room_id, name, motto, look, gender, x, y, z, rotation, "", ( 
    			CASE 
    				WHEN automatic_chat = "false" THEN "0" ELSE "1"
    			END) as chat_auto,
    			mix_sentences,
    			speaking_interval,
    			dance,
    			( CASE WHEN walk_mode = "freeroam" THEN "1" ELSE "0" END ) as freeroam,
    			( CASE 
    				WHEN ai_type = "generic" THEN "generic"
    				WHEN ai_type = "bartender" THEN "bartender"
    				END) as bot_type,
    			effect FROM plus.bots WHERE plus.bots.ai_type = 'generic' OR plus.bots.ai_type = 'bartender';
    			
    INSERT INTO arcturus.catalog_clothing (id, name, setid) SELECT id, clothing_name, clothing_parts FROM plus.catalog_clothing;
    INSERT INTO arcturus.catalog_items (id, page_id, item_ids, catalog_name, cost_credits, cost_points, points_type, amount, limited_stack, limited_sells, extradata, have_offer, offer_id) 
    	SELECT 
    		id, page_id, item_id, catalog_name, cost_credits, 
    		(CASE WHEN cost_diamonds > 0 THEN cost_diamonds ELSE cost_pixels END) as cost_points,
    		(CASE  WHEN cost_diamonds > 0 THEN 105 ELSE 0 END) as points_type,
    		amount, limited_stack, limited_sells,
    		extradata, offer_active, offer_id
    	FROM plus.catalog_items;
    
    INSERT INTO arcturus.catalog_pages (id, parent_id, caption, icon_image, visible, enabled, min_rank, order_num, page_layout, page_headline, page_teaser, page_special, page_text1, page_text2, page_text_details, page_text_teaser ) 
    	SELECT 
    		id, parent_id, caption, icon_image, visible, 
    		enabled, min_rank, order_num, page_layout, 
    		SUBSTRING_INDEX(SUBSTRING_INDEX(page_strings_1, '|', 1), '|', -1) as page_headline,
    		SUBSTRING_INDEX(SUBSTRING_INDEX(page_strings_1, '|', 2), '|', -1) as page_teaser,
    		page_link,
    		SUBSTRING_INDEX(SUBSTRING_INDEX(page_strings_2, '|', 1), '|', -1) as page_text1,
    		SUBSTRING_INDEX(SUBSTRING_INDEX(page_strings_2, '|', 2), '|', 0) as page_text2,
    		"" as page_text_details,
    		"" as page_text_teaser
    	FROM plus.catalog_pages;
    	
    INSERT INTO arcturus.guilds (id, user_id, name, description, room_id, state, rights, color_one, color_two, badge, date_created, forum) SELECT id, owner_id, name, `desc`, room_id, state, admindeco, colour1, colour2, badge, created, has_forum FROM plus.groups;
    INSERT INTO arcturus.guilds_members (id, guild_id, user_id, level_id) SELECT id, group_id, user_id, rank FROM plus.group_memberships;
    INSERT INTO arcturus.items (id, user_id, room_id, item_id, wall_pos, x, y, z, rot, extra_data, limited_data, guild_id) 
    	SELECT 
    		id, user_id, room_id, base_item, 
    		wall_pos, x, y, z, rot, 
    		( CASE WHEN extra_data REGEXP '^-?[0-9]+$' THEN extra_data ELSE "0" END),
    		CONCAT_WS(':', limited_stack, limited_number),
    		group_id
    	FROM plus.items;
    	
    INSERT INTO arcturus.items_base 
    	(id, sprite_id, public_name, item_name, `type`, 
    	width, length, stack_height, allow_stack, 
    	allow_walk, allow_sit, allow_recycle, allow_trade, 
    	allow_marketplace_sell, allow_gift, allow_inventory_stack, 
    	interaction_modes_count, vending_ids, effect_id_male, effect_id_female, multiheight)
    SELECT 
    	id, sprite_id, public_name, item_name, `type`, 
    	width, length, stack_height, can_stack, 
    	is_walkable, can_sit, allow_recycle, allow_trade, 
    	allow_marketplace_sell, allow_gift, allow_inventory_stack, 
    	interaction_modes_count, vending_ids, effect_m, effect_f, REPLACE(height_adjustable, ',', ';')
    FROM plus.furniture;
    UPDATE items_base SET interaction_type = item_name WHERE item_name LIKE 'wf_act_%' OR item_name LIKE 'wf_trg_%' OR item_name LIKE 'wf_cnd_%';
    UPDATE arcturus.items_base INNER JOIN arcturus.items_base_backup ON arcturus.items_base.item_name = arcturus.items_base_backup.item_name
    SET
    	arcturus.items_base.interaction_type = arcturus.items_base_backup.interaction_type,
    	arcturus.items_base.interaction_modes_count = arcturus.items_base_backup.interaction_modes_count;
    UPDATE arcturus.items_base SET arcturus.items_base.allow_walk = '0' WHERE arcturus.items_base.interaction_type LIKE 'gate' OR arcturus.items_base.interaction_type LIKE 'guild_gate';
    UPDATE arcturus.items_base SET arcturus.items_base.allow_lay = '1' WHERE arcturus.items_base.interaction_type LIKE 'bed';
    
    INSERT INTO arcturus.gift_wrappers (sprite_id, item_id, type) SELECT sprite_id, id, (CASE WHEN item_name LIKE 'present_gen%' THEN "gift" ELSE "wrapper" END) FROM arcturus.items_base WHERE item_name LIKE 'present_gen%' OR item_name LIKE 'present_wrap%';
    
    INSERT INTO arcturus.messenger_friendships (id, user_one_id, user_two_id) SELECT NULL, user_one_id, user_two_id FROM plus.messenger_friendships;
    INSERT INTO arcturus.messenger_friendships (id, user_one_id, user_two_id) SELECT NULL, user_two_id, user_one_id FROM plus.messenger_friendships;
    
    UPDATE arcturus.items INNER JOIN arcturus.items_base ON arcturus.items_base.id = arcturus.items.id INNER JOIN plus.items ON arcturus.items.id = plus.items.id SET arcturus.items.extra_data = plus.items.extra_data WHERE arcturus.items_base.interaction_type LIKE 'trophy';
    DELETE FROM arcturus.items WHERE arcturus.items.item_id NOT IN (SELECT id FROM arcturus.items_base WHERE arcturus.items_base.interaction_type LIKE 'gift');
    
    INSERT INTO arcturus.items_teleports SELECT tele_one_id, tele_two_id FROM plus.room_items_tele_links;
    INSERT INTO arcturus.items_hoppers SELECT arcturus.items.id, arcturus.items_base.id FROM arcturus.items INNER JOIN arcturus.items_base ON arcturus.items.item_id = arcturus.items_base.id WHERE arcturus.items_base.interaction_type LIKE 'hopper';
    
    INSERT INTO 
    	arcturus.rooms (
    		id, owner_name, name, description, model, password, state, users, users_max, guild_id, category, score, paper_floor, paper_wall, paper_landscape, thickness_wall, thickness_floor, tags, 
    		allow_other_pets, allow_other_pets_eat, allow_walkthrough, allow_hidewall, chat_mode, chat_weight, chat_speed, chat_hearing_distance, chat_protection, who_can_mute, who_can_kick, who_can_ban, trade_mode
    	) 
    	SELECT 
    		id, owner, caption, description, model_name, password, state, users_now, users_max, group_id, category, score, floor, wallpaper, landscape, wallthick, floorthick, tags, allow_pets, allow_pets_eat, 
    		room_blocking_disabled, allow_hidewall, chat_mode, chat_size, chat_speed, chat_hearing_distance, chat_extra_flood, mute_settings, kick_settings, ban_settings, trade_settings 
    	FROM plus.rooms;
    		
    UPDATE arcturus.rooms INNER JOIN plus.users ON arcturus.rooms.owner_name = plus.users.username SET arcturus.rooms.owner_id = plus.users.id;
    
    INSERT INTO arcturus.room_bans (room_id, user_id, ends) SELECT room_id, user_id, expire FROM plus.room_bans;
    INSERT INTO arcturus.room_rights (room_id, user_id) SELECT room_id, user_id FROM plus.room_rights;
    INSERT INTO arcturus.room_wordfilter (room_id, word) SELECT room_id, word FROM plus.room_filter;
    INSERT INTO arcturus.room_models (name, door_x, door_y, door_dir, heightmap, club_only) SELECT id, door_x, door_y, door_dir, heightmap, club_only FROM plus.room_models WHERE plus.room_models.id NOT LIKE 'model_bc_%';
    INSERT INTO arcturus.room_models_custom (id, name, door_x, door_y, door_dir, heightmap) SELECT REPLACE(id, 'model_bc_', ''), id, door_x, door_y, door_dir, heightmap FROM plus.room_models WHERE plus.room_models.id LIKE 'model_bc_%';
    UPDATE arcturus.rooms INNER JOIN arcturus.room_models_custom ON arcturus.room_models_custom.id = arcturus.rooms.id SET arcturus.rooms.override_model = '1';
    UPDATE arcturus.rooms SET arcturus.rooms.model = 'model_a' WHERE arcturus.rooms.model NOT IN (SELECT name FROM arcturus.room_models);
    
    INSERT INTO arcturus.users (id, username, password, mail, account_created, last_login, last_online, motto, look, gender, rank, credits, ip_register, ip_current, home_room, machine_id)
    SELECT
    	id, username, password, mail, account_created, last_online, last_online, motto, look, gender, rank, credits, ip_reg, ip_last, home_room, machine_id FROM plus.users;
    	
    INSERT INTO arcturus.users_achievements (user_id, achievement_name, progress) SELECT userid, `group`, progress FROM plus.user_achievements;
    INSERT INTO arcturus.users_badges (id, user_id, slot_id, badge_code) SELECT id, user_id, badge_slot, badge_id FROM plus.user_badges;
    INSERT INTO arcturus.users_effects (user_id, effect, duration, activation_timestamp, total) SELECT user_id, effect_id, total_duration, activated_stamp, quantity FROM plus.user_effects;
    INSERT INTO arcturus.users_currency (user_id, type, amount) SELECT id, 0, activity_points FROM plus.users;
    INSERT INTO arcturus.users_currency (user_id, type, amount) SELECT id, 105, vip_points FROM plus.users;
    INSERT INTO arcturus.users_favorite_rooms (user_id, room_id) SELECT user_id, room_id FROM plus.user_favorites;
    INSERT INTO arcturus.users_settings (user_id) SELECT id FROM plus.users;
    UPDATE arcturus.users_settings INNER JOIN plus.user_stats ON arcturus.users_settings.user_id = plus.user_stats.id 
    SET
    	arcturus.users_settings.achievement_score = plus.user_stats.AchievementScore,
    	arcturus.users_settings.respects_given = plus.user_stats.Respect,
    	arcturus.users_settings.respects_received = plus.user_stats.RespectGiven,
    	arcturus.users_settings.guild_id = plus.user_stats.groupid;
    UPDATE arcturus.users_settings INNER JOIN plus.users ON arcturus.users_settings.user_id = plus.users.id
    SET
    	arcturus.users_settings.block_friendrequests = plus.users.block_newfriends,
    	arcturus.users_settings.block_camera_follow = plus.users.focus_preference,
    	arcturus.users_settings.old_chat = plus.users.chat_preference,
    	arcturus.users_settings.ignore_pets = plus.users.pets_muted,
    	arcturus.users_settings.ignore_bots = plus.users.bots_muted,
    	arcturus.users_settings.block_roominvites = plus.users.ignore_invites,
    	arcturus.users_settings.volume_system = SPLIT_STRING(plus.users.volume, ',', 1),
    	arcturus.users_settings.volume_furni = SPLIT_STRING(plus.users.volume, ',', 2),
    	arcturus.users_settings.volume_trax = SPLIT_STRING(plus.users.volume, ',', 3),
    	arcturus.users_settings.nux = '1';
    	
    UPDATE arcturus.users_settings INNER JOIN plus.server_halloffame ON arcturus.users_settings.user_id = plus.server_halloffame.user_id SET arcturus.users_settings.hof_points = plus.server_halloffame.score;
    INSERT INTO arcturus.users_pets (id, user_id, room_id, name, x, y, z, rot) SELECT id, user_id, room_id, name, x, y, z, rotation FROM plus.bots WHERE plus.bots.ai_type LIKE 'pet';
    UPDATE arcturus.users_pets INNER JOIN plus.bots_petdata ON arcturus.users_pets.id = plus.bots_petdata.id
    SET
    	arcturus.users_pets.type = plus.bots_petdata.type,
    	arcturus.users_pets.race = plus.bots_petdata.race,
    	arcturus.users_pets.color = plus.bots_petdata.color,
    	arcturus.users_pets.energy = plus.bots_petdata.energy,
    	arcturus.users_pets.respect = plus.bots_petdata.respect,
    	arcturus.users_pets.created = plus.bots_petdata.createstamp,
    	arcturus.users_pets.hair_style = plus.bots_petdata.pethair,
    	arcturus.users_pets.hair_color = plus.bots_petdata.hairdye,
    	arcturus.users_pets.saddle = plus.bots_petdata.have_saddle,
    	arcturus.users_pets.ride = plus.bots_petdata.anyone_ride,
    	arcturus.users_pets.gnome_data = plus.bots_petdata.gnome_clothing;
    	
    UPDATE arcturus.rooms SET arcturus.rooms.category = 1 WHERE arcturus.rooms.category NOT INT (SELECT id FROM navigator_flatcats);
    UPDATE arcturus.catalog_pages SET caption_save = caption WHERE caption_save LIKE '';
    UPDATE arcturus.achievements SET category = 'test' WHERE category NOT IN ('identity','explore','music','social','games','room_builder','pets','tools','events');
    If you are using Arcturus, contact me
    Skype: wesley.jabbo
    Discord: TheGeneral#4898


  2. #2
    Account Upgraded | Title Enabled! HotelMaker is offline
    True MemberRank
    Dec 2012 Join Date
    309Posts

    Re: Plus to Arcturus convert scripts

    perfect thanks

  3. #3
    Registered Roveral is offline
    MemberRank
    May 2017 Join Date
    24Posts

    Re: Plus to Arcturus convert scripts

    Can you please post a reversed version of this? (Arcturus > Plus)? Thank you.

  4. #4
    You looking at me? Zoxq is offline
    True MemberRank
    Dec 2015 Join Date
    249Posts

    Re: Plus to Arcturus convert scripts

    Well, it wouldn't really make sense if he posted a reversed version.
    Like.. would you if you spent months developing an emulator? He's proud of his work and there is nothing wrong with that.

  5. #5
    Death from above! The General is offline
    The OmegaRank
    Aug 2011 Join Date
    8,728Posts

    Re: Plus to Arcturus convert scripts

    Quote Originally Posted by Zoxq View Post
    Well, it wouldn't really make sense if he posted a reversed version.
    Like.. would you if you spent months developing an emulator? He's proud of his work and there is nothing wrong with that.
    Years*
    If you are using Arcturus, contact me
    Skype: wesley.jabbo
    Discord: TheGeneral#4898

  6. #6
    what a twat is this hat? saamus is offline
    Alpha MaleRank
    Sep 2011 Join Date
    /etc/rc.localLocation
    2,184Posts

    Re: Plus to Arcturus convert scripts

    This SQL script it's heavy omg. But actually works. I really don't like FUNCTIONS inside SQL. But doing it directly on SQL it's really way more perfomatic from doing it in some language...

    Anyways good job!




Advertisement