script input as op?
 

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 input as op?

Started by jay-dee, 03 January, 2007, 23:27:11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jay-dee

if its possible.......

im an operator in a hub from a friend of mine..


i build the hub for him..

but when i see a error syntax or something like that, is it possible to create a LUA script that i can input
"a script"
to the bot and restart scripts??

that after restart the script is in it?


regards jaydee
"i was born house- i will die house"

CrazyGuy

if you have the possibility to add the script into his folder, then yes.
PtokaX has inbuild commands for starting/stopping/restarting scripts

jay-dee

i mean, example...

he doesnt have D2AF.LUA and hes running the hub, but hes on vacation...

i load D2AF.LUA into the script save it and restart the scripts...

now D2AF.LUA is in the script list, is that possible to create such a script, to ---->input extern from the ptokax??

regards jaydee
"i was born house- i will die house"

Snooze

It can be done, though (as CrazyGuy wrote) you would have to have access to the 'scripts' folder on the computer running the hub.
Ex. by script or FTP.


-Snooze

UwV

or you can use a texter ..
a script to read/write texts from
client to files in script folder ..
there is a few not sure what lua versions
but have look for "texter" and you will find it it will do without ftp ..
not really uploading files .. but actually paste copy .. (works for smaller scripts )
 
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

jay-dee

 :D nice script mutor!  thnx! ;D

maybe im a noob  ???

how do i paste a script and save it???
theres only 1 box to save the filename????

help command needs a .txt file???

or im really blind???

regards jaydee
"i was born house- i will die house"

CrazyGuy

copy/paste it to notepad and save it as a .lua file ( set file type to All Files )
or, copy/paste it into PtokaX's Script editor and click save there

UwV

Quote from: Mutor on 05 January, 2007, 00:03:25
This perhaps is not the wisest method, nor is it recommended
for large scripts or files originally formatted as binary.
But here you are , a little rough perhaps but a good start.
As always, comments welcome

--[[
	Script Bot 1.0 LUA 5.0/5.1
	By Mutor	01/03/06

........ the hard work .............


thanks Mutor i was afraid he would ask me where to find it ..  this looks better then the older version that was
so  nice one, once again :))
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

" As always, comments welcome "
" a little rough perhaps but a good start. "
so what about..
a command to change script order ?
that would be a nice next thing i guess .. 

\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

UwV

#9
Quote from: Mutor on 05 January, 2007, 22:34:40
Regarding scripot order:

I have been wanting a API call for the scripts for sometime.
Without this we cannot effect a change in the order properly.
Currently we may only fetch the list of scripts by direct command.
The same goes for the other default script commands.
If we could pull a table from the hub it would open up other options.


i have put a request in feature requests a long time ago ... 
but .. no reply/response on that one :/

so i was thinking more like  .. parsing/overwiting the Scripts.xml ...
just, i am not so sure what happens when we reboot all scripts or even reboot hub..
will PX overwite/read  the xml so we loose the changes  or could that work ?
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

jay-dee

Quote from: CrazyGuy on 05 January, 2007, 16:36:53
copy/paste it to notepad and save it as a .lua file ( set file type to All Files )
or, copy/paste it into PtokaX's Script editor and click save there

hmm wrong question of me, or understood quite different........


how do i paste  a script to the bot, of my friends hub???
return "Save Script"," %[line:Filename (ie. filename.lua]"," %[line:Filename (ie. filename.lua]"


Wher do i paste the script???    its only .LUA    saving..........     ????
"i was born house- i will die house"

UwV

Quote from: Mutor on 06 January, 2007, 15:59:49
Well we could always attempt to overwrite the xml, but
this  should be an API call which would avoid any problems
altogether.

well,  let's all hope PPK reads this and reconsiders the request(s)..   ;)
it would be very convenient if we could have that one ...
\NL   The knowledge and skills you have achieved are meant to be forgotten so you can float comfortably in emptiness, without obstruction.
" Holly loves me,...  . "      ;o)

& don't forget, the motto is :
  -- SUPPORT YOUR LOCAL DJ'S --

jay-dee

 ;D the input on pm(bot) works !!! it loads with no error the script...

i have this script loaded:
-- rightclicker 
rMenu = "~~~~?ShareHider?"
qMenu = "~~~~?Records?"




Prof = { 
 [0] = 1, -- Masters 
 [1] = 1, -- Operators 
 [2] = 1, -- Vips 
 [3] = 1, -- Regs 
 [4] = 1, -- Moderator 
 [5] = 1, -- NetFounder 
 [-1] = 1, -- Users 
} 
-------------------------------------------------------------------------------------------------------------------- 
NewUserConnected = function(user)
	if Prof[user.iProfile] == 1 then
		user:SendData("$UserCommand 0 3")
		if user.iProfile == 0 or user.iProfile == 1   then
                        user:SendData("$UserCommand 1 3 "..rMenu.."\\hideshare $<%[mynick]> !hideshare &#124;")
        user:SendData("$UserCommand 1 3 "..rMenu.."\\unhideshare $<%[mynick]> !unhideshare&#124;")
		end
		if user.iProfile == 0 or user.iProfile == 2   then
                        user:SendData("$UserCommand 1 3 "..qMenu.."\\help $<%[mynick]> !rb.help &#124;")
        user:SendData("$UserCommand 1 3 "..qMenu.."\\show records $<%[mynick]> !rb.show&#124;")
		user:SendData("$UserCommand 1 3 "..qMenu.."\\reset records $<%[mynick]> !rb.reset&#124;")
		end 
	end
end


OpConnected = NewUserConnected


but when i reconnect to the hub this comes in main:

[15:54:19] $UserCommand 0 3
[15:54:19] $UserCommand 1 3 ~~~~?ShareHider?\hideshare $<%[mynick]> !hideshare &#124;
[15:54:19] $UserCommand 1 3 ~~~~?ShareHider?\unhideshare $<%[mynick]> !unhideshare&#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\help $<%[mynick]> !rb.help &#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\show records $<%[mynick]> !rb.show&#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\reset records $<%[mynick]> !rb.reset&#124;


how is this possible ???
"i was born house- i will die house"

jay-dee

 ???

hmm the script is for operator....

can you change it please to operator and above??

running leviathan, and moderator functions is better then operator so if possible please op and above ??

thnx
"i was born house- i will die house"

CrazyGuy

Change

Prof = { 
 [0] = 1, -- Masters 
 [1] = 1, -- Operators 
 [2] = 1, -- Vips 
 [3] = 1, -- Regs 
 [4] = 1, -- Moderator 
 [5] = 1, -- NetFounder 
 [-1] = 1, -- Users 
}


to
Prof = { 
 [0] = 1, -- Masters 
 [1] = 1, -- Operators 
 [2] = 0, -- Vips 
 [3] = 0, -- Regs 
 [4] = 1, -- Moderator 
 [5] = 1, -- NetFounder 
 [6] = 1, -- Owner profile in Leviathan
 [-1] = 0, -- Users 
}

the-master

noticed a problem whit the script bot  :(
after 6 days my hub refused to send messages from operators in pm and main whit the comment:
you dont have permission to use this command.
seems to disturb the other hubscripts/settings

i stopped scriptbot and problem was gone
advise to start the script only when needed
keep on sharing :)

plop

Quote from: jay-dee on 07 January, 2007, 16:01:34
;D the input on pm(bot) works !!! it loads with no error the script...

i have this script loaded:
-- rightclicker 
rMenu = "~~~~?ShareHider?"
qMenu = "~~~~?Records?"




Prof = { 
 [0] = 1, -- Masters 
 [1] = 1, -- Operators 
 [2] = 1, -- Vips 
 [3] = 1, -- Regs 
 [4] = 1, -- Moderator 
 [5] = 1, -- NetFounder 
 [-1] = 1, -- Users 
} 
-------------------------------------------------------------------------------------------------------------------- 
NewUserConnected = function(user)
	if Prof[user.iProfile] == 1 then
		user:SendData("$UserCommand 0 3")
		if user.iProfile == 0 or user.iProfile == 1   then
                        user:SendData("$UserCommand 1 3 "..rMenu.."\\hideshare $<%[mynick]> !hideshare &#124;")
        user:SendData("$UserCommand 1 3 "..rMenu.."\\unhideshare $<%[mynick]> !unhideshare&#124;")
		end
		if user.iProfile == 0 or user.iProfile == 2   then
                        user:SendData("$UserCommand 1 3 "..qMenu.."\\help $<%[mynick]> !rb.help &#124;")
        user:SendData("$UserCommand 1 3 "..qMenu.."\\show records $<%[mynick]> !rb.show&#124;")
		user:SendData("$UserCommand 1 3 "..qMenu.."\\reset records $<%[mynick]> !rb.reset&#124;")
		end 
	end
end


OpConnected = NewUserConnected


but when i reconnect to the hub this comes in main:

[15:54:19] $UserCommand 0 3
[15:54:19] $UserCommand 1 3 ~~~~?ShareHider?\hideshare $<%[mynick]> !hideshare &#124;
[15:54:19] $UserCommand 1 3 ~~~~?ShareHider?\unhideshare $<%[mynick]> !unhideshare&#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\help $<%[mynick]> !rb.help &#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\show records $<%[mynick]> !rb.show&#124;
[15:54:19] $UserCommand 1 3 ~~~~?Records?\reset records $<%[mynick]> !rb.reset&#124;


how is this possible ???

my guess would be that your not using the standard dc++ client but some mod or totaly different client.
some of those format the text, which can cause the hub to recieve the script in a screwed up way (for example magic chars get escaped).

plop
http://www.plop.nl lua scripts/howto\'s.
http://www.thegoldenangel.net
http://www.vikingshub.com
http://www.lua.org

>>----> he who fights hatred with hatred, drives the spreading of hatred <----<<

CrazyGuy

looks like a client not having supporting UserCommand

bastya_elvtars

user.bUserCommand might help in this case.
Everything could have been anything else and it would have just as much meaning.

SMF spam blocked by CleanTalk