Skocz do zawartości

  • Zaloguj korzystając z Facebooka Zaloguj korzystając z Twittera Zaloguj przez Steam Zaloguj poprzez Google      Logowanie »   
  • Rejestracja

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.

  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

[ANY] Source***


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 Adminek AMXX.PL

    Admin :)

  • Bot

Reputacja: 156
Profesjonalista

  • Postów:7179
  • Lokalizacja:AMXX.PL
Offline

Napisano 18.02.2016 19:10

<div><div align="center"><b><font size="6">&lt;Source Fuck&gt;</font></b></div><br /><br /><br /><br /><font size="4"><b>Introdution</b></font><br /><br />This is a plugin for Sourcemod which provides a configurable and controllable<br />virtual machine that runs brainfuck.<br /><br /><br /><br /><font size="4"><b>Requirements</b></font><br /><br />this plugin needs the things listed below to work:<br /><ul><li>nothing without SM and MM</li>
</ul><br /><br /><br /><font size="4"><b>Installation</b></font><br /><br />to install this plugin<br /><ul><li>put the smx file in the sourcemod/plugins folder</li>
</ul>to compile this plugin manually<br /><ul><li>put all sp files in the sourcemod/scripting folder</li>
<li>put all inc files in the sourcemod/scripting/include folder</li>
<li>compile.</li>
</ul><br /><br /><br /><b><font size="4">Configuration</font></b><br /><br />this plugin has nothing to config<br /><br /><br /><br /><b><font size="4">Example</font></b><br /><br />To use this plugin, you need to make another plugin that uses native functions of this plugin. those are<br /><br />native ArrayList SF_CreateVirtualMachine(const char[] name, int codememsize, int datamemsize, int inputmemsize, int outputmemsize);<br />native ArrayList SF_FindVirtualMachine(const char[] name);<br />native int SF_DeleteVirtualMachine(ArrayList vm);<br />native void SF_SetVirtualMachineInstruction(ArrayList vm, const char[] token, SF_INSTRUCTION inst);<br />native ArrayList SF_GetVirtualMachineInstruction(ArrayList vm, SF_INSTRUCTION inst);<br />native void SF_SetVirtualMachineProperty(ArrayList vm, SF_PROPERTY prop, int value);<br />native any SF_GetVirtualMachineProperty(ArrayList vm, SF_PROPERTY prop);<br />native void SF_SetVirtualMachineMemory(ArrayList vm, SF_MEMORY memtype, const char[] buffer, int maxlength);<br />native void SF_GetVirtualMachineMemory(ArrayList vm, SF_MEMORY memtype, char[] buffer, int maxlength);<br />native SF_STATUS SF_ExecuteMachine(ArrayList vm, int maxinstcount);<br />native void SF_ResetVirtualMachine(ArrayList vm);<br /><br />and there is an example test plugin code for this, which will print Hello World!n 5 in server console when map starts.<br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Code:</div>
<hr /><code style="margin:0px" dir="ltr" style="text-align:left">#include &lt;sourcemod&gt;<br /><br />#include &lt;sourcefuck/sourcefuck&gt;<br /><br />#pragma newdecls required<br /><br />#define PLUGIN_VERSION &quot;1.0.0.0&quot;<br /><br />public Plugin myinfo = {<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; name = &quot;SourceFuckTest&quot;,<br />&nbsp; &nbsp; author = &quot;javalia&quot;,<br />&nbsp; &nbsp; description = &quot;SourceFuck virtual machine&quot;,<br />&nbsp; &nbsp; version = PLUGIN_VERSION,<br />&nbsp; &nbsp; url = &quot;[url="http://www.sourcemod.net/""]http://www.sourcemod.net/&quot;<br[/url]/>&nbsp; &nbsp; <br />};<br /><br />public void OnPluginStart(){<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; CreateConVar(&quot;sourcefucktest_version&quot;, PLUGIN_VERSION, &quot;plugin version&quot;, FCVAR_DONTRECORD);<br />&nbsp; &nbsp; <br />}<br /><br />public void OnMapStart(){<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; ArrayList vm = SF_CreateVirtualMachine(&quot;Nyaruko&quot;, 1024, 1024, 1024, 1024);<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;Woo!Nya!&quot;, SF_INST_BP_INC);<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;Woo~Nya~&quot;, SF_INST_BP_DEC);<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;Woo!Nya~&quot;, SF_INST_BP_DRF_INC);<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;Woo~Nya!&quot;, SF_INST_BP_DRF_DEC);<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;Let`s Nya!&quot;, SF_INST_BP_DRF_PRINT);<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;Sanchi pinch!&quot;, SF_INST_BP_DRF_INPUT);<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;Chaos! Chaos!&quot;, SF_INST_LOOPSTART);<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;I Want a Chaos!&quot;, SF_INST_LOOPEND);<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;n&quot;, SF_INST_WHITESPACE);//newline<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot; &quot;, SF_INST_WHITESPACE);//this is whitespace<br />&nbsp; &nbsp; SF_SetVirtualMachineInstruction(vm, &quot;&nbsp; &nbsp; &quot;, SF_INST_WHITESPACE);//this is tab<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; //... is pawn`s internal multiple line string connector<br />&nbsp; &nbsp; char codemem[1024] = &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Chaos! Chaos! Woo!Nya! Woo!Nya~ Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya!&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya! Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya!&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo~Nya~ Woo~Nya~ Woo~Nya~ Woo~Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo~Nya! I Want a Chaos! Woo!Nya! Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Let`s Nya! Woo!Nya! Woo!Nya~ Let`s Nya! Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Let`s Nya! Let`s Nya! Woo!Nya~ Woo!Nya~ Woo!Nya~ Let`s Nya!&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya! Woo!Nya~ Woo!Nya~ Let`s Nya! Woo~Nya~ Woo~Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~ Woo!Nya~&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Let`s Nya! Woo!Nya! Let`s Nya!&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo!Nya~ Woo!Nya~ Woo!Nya~ Let`s Nya! Woo~Nya! Woo~Nya!&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo~Nya! Woo~Nya! Woo~Nya! Woo~Nya! Let`s Nya! Woo~Nya!&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo~Nya! Woo~Nya! Woo~Nya! Woo~Nya! Woo~Nya! Woo~Nya!&quot; ...<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;Woo~Nya! Let`s Nya! Woo!Nya! Woo!Nya~ Let`s Nya! Woo!Nya! Let`s Nya!&quot;;<br />&nbsp; &nbsp; char outputmem[1024];<br />&nbsp; &nbsp; SF_SetVirtualMachineMemory(vm, SF_MEMORY_CODE, codemem, 1024);<br />&nbsp; &nbsp; SF_STATUS status =&nbsp; SF_ExecuteMachine(vm, -1);<br />&nbsp; &nbsp; SF_GetVirtualMachineMemory(vm, SF_MEMORY_OUTPUT, outputmem, 1024);<br />&nbsp; &nbsp; PrintToServer(&quot;%s %d&quot;, outputmem, status);<br />&nbsp; &nbsp; <br />}<br /><br />public void OnMapEnd(){<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; ArrayList vm = SF_FindVirtualMachine(&quot;Nyaruko&quot;);<br />&nbsp; &nbsp; if(vm != null){<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; PrintToServer(&quot;calling delete virtual machine&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; SF_DeleteVirtualMachine(vm);<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; <br />&nbsp; &nbsp; return;<br />&nbsp; &nbsp; <br />}</code><hr />
</div><br /><br /><font size="4"><b>Known Bugs &amp; Limits of the plugin</b></font><br /><br />Limits<br /><ul><li>this brainfuck vm has no infinite memory. but however, u can allocate big memory if u want.</li>
<li>maximum length of a token should be shorter then 256, for there is a bug in SM(compiler or SM iself or something else. but i tested this enough and i dont think its my code`s bug).</li>
</ul> <br /><br /><br /><font size="4"><b>Special Thanks To</b></font><br /><br />i want to say thanks to these guys<br /><ul><li>dvander, for making 1.7 syntax for everyone.</li>
<li>other guys who talked with me and answered to me about my questions in the irc channel.</li>
</ul><br /><br /><br /><font size="4"><b>Change Log</b></font><br /><br />All the date`s format is y/m/d<br /><div style="margin:20px; margin-top:5px">
<div class="smallfont" style="margin-bottom:2px">Code:</div>
<hr /><code style="margin:0px" dir="ltr" style="text-align:left">update at 2016 02 19(ver 1.0.0.0) <ul><li>released</li><br /></ul></code><hr />
</div></div>


<br /> <div style="padding:6px">








<fieldset class="fieldset">
<legend>Attached Files</legend>
<table cellpadding="0" cellspacing="3" border="0">
<tr>
<td><img class="inlineimg" src="https://forums.allie...attach/zip.gif"alt="File Type: zip" width="16" height="16" border="0" style="vertical-align:baseline" /></td>
<td>


<a href="https://forums.allie....0.0.0).zip</a>(22.4 KB)


</td>
</tr>
</table>
</fieldset>


</div>

Wyświetl pełny artykuł




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych