Script with commands like slap, shoot etc etc.
 

News:

29 December 2022 - PtokaX 0.5.3.0 (20th anniversary edition) released...
11 April 2017 - PtokaX 0.5.2.2 released...
8 April 2015 Anti child and anti pedo pr0n scripts are not allowed anymore on this board!
28 September 2015 - PtokaX 0.5.2.1 for Windows 10 IoT released...
3 September 2015 - PtokaX 0.5.2.1 released...
16 August 2015 - PtokaX 0.5.2.0 released...
1 August 2015 - Crowdfunding for ADC protocol support in PtokaX ended. Clearly nobody want ADC support...
30 June 2015 - PtokaX 0.5.1.0 released...
30 April 2015 Crowdfunding for ADC protocol support in PtokaX
26 April 2015 New support hub!
20 February 2015 - PtokaX 0.5.0.3 released...
13 April 2014 - PtokaX 0.5.0.2 released...
23 March 2014 - PtokaX testing version 0.5.0.1 build 454 is available.
04 March 2014 - PtokaX.org sites were temporary down because of DDOS attacks and issues with hosting service provider.

Main Menu

Script with commands like slap, shoot etc etc.

Started by RF, 26 January, 2005, 16:50:33

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RF

Hello, new in here  :))

I have been trying and trying to make a script what would have commands like +slap, +shoot, +kiss etc etc, just few commands.

I have no experience in programming so that must be the reason why i did not get anything to work, so i copied one simple slap script from here and tried to add new commands to it but i always got somekind of error, lost my nervs and now i finally realized that someone in here who would be that kind, could make somekind of simple script to here and tell me how to add simple commands to it.

I will be really appreciated who can make me a simple script like that.

Thanks.

//RF

fallen_

QuoteOriginally posted by RF
Hello, new in here  :))

I have been trying and trying to make a script what would have commands like +slap, +shoot, +kiss etc etc, just few commands.

I have no experience in programming so that must be the reason why i did not get anything to work, so i copied one simple slap script from here and tried to add new commands to it but i always got somekind of error, lost my nervs and now i finally realized that someone in here who would be that kind, could make somekind of simple script to here and tell me how to add simple commands to it.

I will be really appreciated who can make me a simple script like that.

Thanks.

//RF


--puncher.lua by Romulus 2003-04-12 

botname="Ringside" 

function DataArrival(user, data) 

data=strsub(data,1,strlen(data)-1) 

s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)%s+(%S+)") 

if (cmd=="!punch") then 

	if not (arg==nil) then 

		local tmp = GetItemByName(arg) 

		if (tmp==nil) then 

			SendToAll(botname,""..user.sName.." tries to punch "..arg..", but swings in thin air!") 

		end 

		if not (tmp==nil) then 

			SendToAll(botname, ""..user.sName.." socks "..arg.." right in the nose!") 

		end 

	return 1 

end 



end 

end
try and change. :)

Tw?sT?d-d?v

You could try madman,s funscript....

it,s very good :))

it has these cmds plus more

you can find this in finished scripts

RF

Thanks for answers guys.

And yes, i have tried funscript but it was not meant to me, if you know what i mean ;)

Let's see if this helps.
Bot = "Slapper"



function DataArrival(curUser, data)

   if strsub(data,1,1) == "<" then

   data=strsub(data,1,strlen(data)-1)

   s,e,cmd,arg = strfind(data,"%b<>%s+(%S+)%s+(.*)")

   
      if cmd=="+slap" then

         SendToAll(Bot, curUser.sName.." slaps "..arg.." with a fresh herring") return 1

       end

    end

end

in which part of that code i need to add other commands (like punch command) if i want them to same script or is it even possible with this sample?

Thanks again.

//RF

Madman

Bot = "Slapper"

function DataArrival(curUser,data)
	if strsub(data, 1, 1) == "<" then
	data=strsub(data,1,strlen(data)-1)
	s,e,cmd = strfind(data,"%b<>%s+(%S+)")
	---Slap Start
		if cmd == "!slap" then --//The Command...
		local s,e,victim = strfind(data, "%b<>%s+%S+%s+(%S+)")
			if victim == nil then --//Forgot Nick?
				curUser:SendData(Bot, "Syntax: "..cmd.." nick") --//If So Send This
				return 1 --//Hides The Commands
			end
		vUser = GetItemByName(victim) --//vUser And Victim Is The Same, Also Checks If Victim Is Online
			if not vUser then --//User Wasent online
				curUser:SendData(Bot, " *** " ..victim.." is not online or wrong name...") --//Wrong Name, Or USer Offline
				return 1
			end
				SendToAll(Bot, curUser.sName.." slaps "..vUser.sName.." around with a large trout.")--//Do To A User
		return 1
		end
	---Slap End
	---Punch Start
		if cmd == "!punch" then
		local s,e,victim = strfind(data, "%b<>%s+%S+%s+(%S+)")
			if victim == nil then
				curUser:SendData(Bot, "Syntax: "..cmd.." nick")
				return 1
			end
		vUser = GetItemByName(victim)
			if not vUser then
				curUser:SendData(Bot, " *** " ..victim.." is not online or wrong name...")
				return 1
			end
				SendToAll(Bot, curUser.sName.." socks "..vUser.sName.." right in the nose!")
		return 1
		end
	---Punch End
	end
end

This might help... Just Copy from -- Slap Start to --Slap end and change the command and the text's =)
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

RF

Thank you madman, that was exactly what i was searching for. :)

Madman

np, always happy to help =)
We suffer in silence, we lurk in the shadows, we kill in the night
Site currently down, ETA of returning online is 2099 ;p

pHaTTy

not done scripting for a long time, not sureif this is right, but give this a go

--//Mini Fun Bot by Pha
--//v1.00

function Main()
	uTrigs = { ["+"]=1,["-"]=1,["!"]=1,["#"]=1 }

	uSets = {
		--//Later Additions
		sName = "sLuT"
	}

	eCommands = {
		["slap"] = {FuncSlap, "Slap a user",1},
		["punsh"] = {FuncPunsh, "Punsh a user",1},

	}

end;


function CheckUser(ud,dd)
	local s,e,victim = strfind(data, "%b<>%s+%S+%s+(%S+)")
	if victim == nil then
		ud:SendData(eSets.sName, "Syntax: "..cmd.." nick")
		return nil
	else
		user = GetItemByName(victim)
		if not user then
			ud:SendData(eSets.sName, " *** " ..victim.." is not online or wrong nick...")
			return nil
		else
			return user
		end;
	end;
end;


function FuncSlap(ud,dd)
	user = CheckUser(ud,dd)
	if user <> nil then
		SendToAll(eSets.sName, ud.sName.." slaps "..user.sName.." around with a large trout.")
	end;
	return 1;
end;

function FuncPunsh(ud,dd)
	user = CheckUser(ud,dd)
	if user <> nil then
		SendToAll(eSets.sName, ud.sName.." socks "..user.sName.." right in the nose!")
	end;
	return 1;
end;

function DataArrival(ud,dd)
	if strsub(dd, 1, 1) == "<" then
		local data=strsub(dd,1,strlen(dd)-1)
		local s,e,prefix,cmd = strfind(dd, "%b<>%s+(%S)(%S+)")
		if prefix == nil then
			return 0;
		if eTrigs[prefix] == 1 then
			cmd = strlower(cmd)

			if eCommands[cmd] then
				if eCommands[cmd][4] == 1 then
					eCommands[cmd][1](ud,dd)
				else
					ud:SendData(eSets.sName,"Sorry command is disabled!")
					return 1;
				end;
			end;
		end;
	end;
end;

-/pha
Resistance is futile!

SMF spam blocked by CleanTalk