Guest User

Untitled

a guest
Feb 21st, 2018
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.28 KB | None | 0 0
  1. <cfflush interval="1">
  2. <cfscript>
  3. /**
  4. * Case-sensitive function for removing duplicate entries in a list.
  5. * Based on dedupe by Raymond Camden
  6. *
  7. * @param list The list to be modified.
  8. * @return Returns a list.
  9. * @author Jeff Howden (jeff@members.evolt.org)
  10. * @version 1, March 21, 2002
  11. */
  12. function ListDeleteDuplicates(list) {
  13. var i = 1;
  14. var delimiter = ',';
  15. var returnValue = '';
  16. if(ArrayLen(arguments) GTE 2)
  17. delimiter = arguments[2];
  18. list = ListToArray(list, delimiter);
  19. for(i = 1; i LTE ArrayLen(list); i = i + 1)
  20. if(NOT ListFind(returnValue, list[i], delimiter))
  21. returnValue = ListAppend(returnValue, list[i], delimiter);
  22. return returnValue;
  23. }
  24. </cfscript>
  25. <cfset iniFile = "D:\quests.scp">
  26. <cfset StructQuest=GetProfileSections(iniFile)>
  27. <cfset listaNew = "questId,zoneId,questFlags,title,details,objectives,completedText,incompleteText,secondText,partText1,partText2,partText3,partText4,reqLevel,questLevel,prevQuests,previousQuest1,previousQuest2,previousQuest3,previousQuest4,previousQuest5,previousQuest6,previousQuest7,previousQuest8,previousQuest9,previousQuest10,lprevQuests,lpreviousQuest1,lpreviousQuest2,lpreviousQuest3,lpreviousQuest4,lpreviousQuest5,lpreviousQuest6,lpreviousQuest7,lpreviousQuest8,lpreviousQuest9,lpreviousQuest10,lockQuests,lockQuest1,lockQuest2,lockQuest3,lockQuest4,lockQuest5,lockQuest6,lockQuest7,lockQuest8,lockQuest9,lockQuest10,questItemId1,questItemId2,questItemId3,questItemId4,questItemCount1,questItemCount2,questItemCount3,questItemCount4,questMobId1,questMobId2,questMobId3,questMobId4,questMobCount1,questMobCount2,questMobCount3,questMobCount4,choiceRewards,choiceItemId1,choiceItemId2,choiceItemId3,choiceItemId4,choiceItemId5,choiceItemId6,choiceItemCount1,choiceItemCount2,choiceItemCount3,choiceItemCount4,choiceItemCount5,choiceItemCount6,itemRewards,rewardItemId1,rewardItemId2,rewardItemId3,rewardItemId4,,rewardItemCount1,rewardItemCount2,rewardItemCount3,rewardItemCount4,rewardGold,repFaction1,repFaction2,repValue1,repValue2,srcItem,nextQuest,learnSpell,timeMinutes,questType,questRaces,questClass,questTrSkill,questBehavior,locationid,locationx,locationy,locationz">
  28.  
  29. <cfset listaOld ="name,started_by,finished_by,levels,next_quest,qtflags,quest_flags,reward_xp,reputation,desc,completion,details,zonename,zone,marker,delivername,deliver,requirements,src_item,incomplete,precompletionname,precompletion,reward_choicename,reward_choice,reward_goldname,reward_gold,killname,kill,reward_itemname,reward_item,sidename,side,reward_spellname,reward_spell,req_moneyname,req_money,reward_buffname,reward_buff,explorename,explore,incompletionname,incompletion,time_minutesname,time_minutes,areaname,area,factionname,faction">
  30. <cfset QuestTableDefinition = QueryNew("WAD,KOBOLD,SAMPLE")>
  31. <cfscript>
  32. QueryAddRow(QuestTableDefinition,1);
  33. QuerySetCell(QuestTableDefinition,"WAD","zone");
  34. QuerySetCell(QuestTableDefinition,"KOBOLD",ListGetAt(listaNew,2));
  35. QuerySetCell(QuestTableDefinition,"sample","44");
  36. QueryAddRow(QuestTableDefinition,1);
  37. QuerySetCell(QuestTableDefinition,"WAD","quest_flags");
  38. QuerySetCell(QuestTableDefinition,"KOBOLD",ListGetAt(listaNew,3));
  39. QuerySetCell(QuestTableDefinition,"sample","8");
  40. QueryAddRow(QuestTableDefinition,1);
  41. QuerySetCell(QuestTableDefinition,"WAD","name");
  42. QuerySetCell(QuestTableDefinition,"KOBOLD",ListGetAt(listaNew,4));
  43. QuerySetCell(QuestTableDefinition,"sample","Assessing the Threat");
  44. QueryAddRow(QuestTableDefinition,1);
  45. QuerySetCell(QuestTableDefinition,"WAD","details");
  46. QuerySetCell(QuestTableDefinition,"KOBOLD",ListGetAt(listaNew,5));
  47. QuerySetCell(QuestTableDefinition,"sample","#JSStringFormat("We don't have men to spare, but something must be done about those gnolls you reported to me.$B$BScout southern Redridge for gnolls. Harry them, kill those you can and report back to me with a count of their numbers and an assessment of the threat they present. You may find those gnolls camped all along the southern road of Redridge.$B$BDo this for the Stormwind Army, $N, and you will be rewarded.
  48. ")#");
  49. QueryAddRow(QuestTableDefinition,1);
  50. QuerySetCell(QuestTableDefinition,"WAD","desc");
  51. QuerySetCell(QuestTableDefinition,"KOBOLD",ListGetAt(listaNew,6));
  52. QuerySetCell(QuestTableDefinition,"sample","#JSStringFormat("Kill 10 Redridge Mongrels and 6 Redridge Poachers, then report back to Deputy Feldon in Lakeshire.
  53. ")#");
  54. QueryAddRow(QuestTableDefinition,1);
  55. QuerySetCell(QuestTableDefinition,"WAD","completion");
  56. QuerySetCell(QuestTableDefinition,"KOBOLD",ListGetAt(listaNew,7));
  57. QuerySetCell(QuestTableDefinition,"sample","#JSstringFormat("<Deputy Feldon listens to your report...>$b$bThere's a sizable force of gnolls encamped there, and from what you tell me they are tough ones. It must not have been easy for you to gather this intelligence.$b$bHere you are, $N. We are grateful for your aid.$b$bAnd if you haven't already done so, speak with Marshal Marris and Magistrate Solomon within Lakeshire. Our situation grows ever more desperate - those two will have need of you I'm sure.
  58. ")#");
  59. QueryAddRow(QuestTableDefinition,1);
  60. QuerySetCell(QuestTableDefinition,"WAD","incomplete");
  61. QuerySetCell(QuestTableDefinition,"KOBOLD",ListGetAt(listaNew,8));
  62. QuerySetCell(QuestTableDefinition,"sample","#JSStringFormat("Ah, is the note translated? Please, let me see it...")#");
  63.  
  64. //engine
  65. //Recorremos la estructura
  66.  
  67. </cfscript>
  68.  
  69. <cfset llaves = StructKeyArray(StructQuest)>
  70. <cfset campos = QuestTableDefinition.Columnlist>
  71. <cfoutput>
  72. <cfloop from="1" to="15" index="j">
  73. <!---======================<br>
  74. #llaves[j]#<br>
  75. ======================<br>
  76. ---> <cfset SqlTxt = "INSERT INTO `quests` VALUES ('#listgetat(llaves[j],2," ")#',">
  77. <cfoutput query="QuestTableDefinition">
  78. <!---#Kobold# : <cftry><cfset temp = "'#JSStringFormat(GetProfileString(iniFile,llaves[j],wad))#'">#JSStringFormat(GetProfileString(iniFile,llaves[j],wad))#<br /><cfcatch type="any"><cfset temp = "'0'">No tiene<br /></cfcatch></cftry> --->
  79. <cftry><cfset temp = "'#JSStringFormat(GetProfileString(iniFile,llaves[j],wad))#'"><cfcatch type="any"><cfset temp = "'0'"></cfcatch></cftry>
  80.  
  81.  
  82.  
  83. <!--- Creamos el Insert segun el orden --->
  84. <cfset Sqltxt = SqlTxT & temp & ",">
  85. </cfoutput>
  86. <cfset Sqltxt = removechars(SqlTxt,len(SqlTxt),1) & ");">
  87. <br />
  88. #SqlTxt#
  89. <br />
  90. </cfloop>
  91. </cfoutput>
Add Comment
Please, Sign In to add comment